Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/webapp/stu/current.jsp
This commit is contained in:
commit
7cdc0a8821
@ -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>
|
@ -21,19 +21,15 @@ public class StuConsultController {
|
|||||||
this.orderDao = orderDao;
|
this.orderDao = orderDao;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/stu/consult")
|
@RequestMapping("/stu/consult.do")
|
||||||
public String consult(HttpServletRequest request, @SessionAttribute Stu stu) {
|
public String consult(HttpServletRequest request, @SessionAttribute Stu stu) {
|
||||||
ArrayList<Order> orders = orderDao.findByStudent_id(stu.getUserid());
|
ArrayList<Order> orders = orderDao.findByStudent_id(stu.getUserid());
|
||||||
if(orders!=null) {
|
if (orders != null) {
|
||||||
System.out.println(orders);
|
|
||||||
request.setAttribute("Orders", orders);
|
request.setAttribute("Orders", orders);
|
||||||
}else{
|
} else {
|
||||||
System.out.println("订单空");
|
request.setAttribute("stuConsultMess", "订单为空");
|
||||||
request.setAttribute("stuConsultMess","订单为空");
|
|
||||||
}
|
}
|
||||||
return "/stu/consult";
|
return "/stu/consult";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,11 @@ package cn.edu.cqwu.repair.controller.stu;
|
|||||||
|
|
||||||
import cn.edu.cqwu.repair.dao.OrderDao;
|
import cn.edu.cqwu.repair.dao.OrderDao;
|
||||||
import cn.edu.cqwu.repair.entity.Order;
|
import cn.edu.cqwu.repair.entity.Order;
|
||||||
import cn.edu.cqwu.repair.entity.OrderStatus;
|
|
||||||
import cn.edu.cqwu.repair.entity.Stu;
|
import cn.edu.cqwu.repair.entity.Stu;
|
||||||
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.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.SessionAttribute;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -21,30 +21,15 @@ public class StuCurrentController {
|
|||||||
public StuCurrentController(OrderDao orderDao) {
|
public StuCurrentController(OrderDao orderDao) {
|
||||||
this.orderDao = orderDao;
|
this.orderDao = orderDao;
|
||||||
}
|
}
|
||||||
@GetMapping("/stu/current")
|
|
||||||
|
@GetMapping("/stu/current.do")
|
||||||
public String current(HttpServletRequest request, @SessionAttribute Stu stu) {
|
public String current(HttpServletRequest request, @SessionAttribute Stu stu) {
|
||||||
ArrayList<Order> orders = orderDao.findByStudent_id(stu.getUserid());
|
ArrayList<Order> orders = orderDao.findCurrent(stu.getUserid());
|
||||||
ArrayList<Order> orders1 = new ArrayList<>();
|
if (orders != null) {
|
||||||
for (Order order : orders) {
|
request.setAttribute("Orders", orders);
|
||||||
if(order.getOrderStatus()== OrderStatus.UNASSIGNED.value|| order.getOrderStatus()==OrderStatus.PROGRESS.value){
|
} else {
|
||||||
|
request.setAttribute("stuCurrentMess", "订单为空");
|
||||||
orders1.add(order);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(orders1!=null) {
|
|
||||||
System.out.println(orders1);
|
|
||||||
request.setAttribute("Orders", orders1);
|
|
||||||
}else{
|
|
||||||
System.out.println("订单空");
|
|
||||||
request.setAttribute("stuCurrentMess","订单为空");
|
|
||||||
}
|
}
|
||||||
return "/stu/current";
|
return "/stu/current";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,54 +2,60 @@ package cn.edu.cqwu.repair.controller.stu;
|
|||||||
|
|
||||||
import cn.edu.cqwu.repair.dao.StuDao;
|
import cn.edu.cqwu.repair.dao.StuDao;
|
||||||
import cn.edu.cqwu.repair.entity.Stu;
|
import cn.edu.cqwu.repair.entity.Stu;
|
||||||
import cn.edu.cqwu.repair.entity.mapper.StuMapper;
|
|
||||||
import com.mybatisflex.core.activerecord.Model;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpRequest;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.Mapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.SessionAttribute;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xtaod
|
||||||
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
|
|
||||||
public class StuDataController {
|
public class StuDataController {
|
||||||
StuDao stuDao;
|
StuDao stuDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public StuDataController(StuDao stuDao) {
|
public StuDataController(StuDao stuDao) {
|
||||||
this.stuDao = stuDao;
|
this.stuDao = stuDao;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @RequestMapping(value = "/stu/data")
|
@RequestMapping("/stu/edit.do")
|
||||||
// public String stuData( ) {
|
public String stuData(@SessionAttribute Stu stu, MultipartFile myfile, String gender, HttpServletRequest req) {
|
||||||
// return "stu/data";
|
String path = req.getServletContext().getRealPath("/upload/" + stu.getUserNo() + "/");
|
||||||
// }
|
File file = new File(path);
|
||||||
|
if (!file.exists()) {
|
||||||
@PostMapping("stu/data")
|
file.mkdirs();
|
||||||
public String stuData(@Param("username")String username, @Param("gender")String gender, HttpServletRequest req){
|
}
|
||||||
Stu stu = new Stu();
|
String filename = myfile.getOriginalFilename();
|
||||||
Stu stu1 = (Stu)req.getSession().getAttribute("stu");
|
if (filename != null && (filename.endsWith(".jpg") || filename.endsWith(".JPG"))) {
|
||||||
|
try {
|
||||||
stu.setUsername(username);
|
myfile.transferTo(new File(path + "/photo.jpg"));
|
||||||
stu.setGender(gender);
|
} catch (Exception e) {
|
||||||
stu.setPassword(stu1.getPassword());
|
e.printStackTrace();
|
||||||
stu.setUserid(stu1.getUserid());
|
}
|
||||||
stu.setRegip(stu1.getRegip());
|
stu.setPhoto("/upload/" + stu.getUserNo() + "/photo.jpg");
|
||||||
stu.setStatus(stu1.getStatus());
|
} else {
|
||||||
stu.setRegtime(stu1.getRegtime());
|
req.setAttribute("stuEditMess", "图片格式不正确");
|
||||||
stu.setUpdateTime(stu1.getUpdateTime());
|
return "/stu/data";
|
||||||
stu.setUserNo(stu1.getUserNo());
|
|
||||||
int update = stuDao.update(stu);
|
|
||||||
if(update>0){
|
|
||||||
req.setAttribute("stuMess", "修改成功");
|
|
||||||
|
|
||||||
}else{
|
|
||||||
req.setAttribute("stuMess", "修改失败");
|
|
||||||
}
|
}
|
||||||
return "stu/data";
|
|
||||||
|
|
||||||
|
if ("male".equals(gender) || "female".equals(gender)) {
|
||||||
|
stu.setGender(gender);
|
||||||
|
} else {
|
||||||
|
req.setAttribute("stuEditMess", "性别格式不正确");
|
||||||
|
return "/stu/data";
|
||||||
|
}
|
||||||
|
|
||||||
|
int update = stuDao.update(stu);
|
||||||
|
if (update > 0) {
|
||||||
|
req.setAttribute("stuEditMess", "修改成功");
|
||||||
|
} else {
|
||||||
|
req.setAttribute("stuEditMess", "修改失败");
|
||||||
|
}
|
||||||
|
return "/stu/data";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,58 +1,119 @@
|
|||||||
|
|
||||||
|
|
||||||
package cn.edu.cqwu.repair.controller.stu;
|
package cn.edu.cqwu.repair.controller.stu;
|
||||||
|
|
||||||
import cn.edu.cqwu.repair.dao.DeviceDao;
|
import cn.edu.cqwu.repair.dao.DeviceDao;
|
||||||
import cn.edu.cqwu.repair.dao.OrderDao;
|
import cn.edu.cqwu.repair.dao.OrderDao;
|
||||||
import cn.edu.cqwu.repair.dao.StuDao;
|
import cn.edu.cqwu.repair.dao.StuDao;
|
||||||
import cn.edu.cqwu.repair.entity.Order;
|
import cn.edu.cqwu.repair.entity.*;
|
||||||
import cn.edu.cqwu.repair.entity.Stu;
|
|
||||||
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.web.bind.annotation.Mapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.SessionAttribute;
|
import org.springframework.web.bind.annotation.SessionAttribute;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xtaod
|
||||||
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class StuUploadController {
|
public class StuUploadController {
|
||||||
|
|
||||||
StuDao stuDao;
|
StuDao stuDao;
|
||||||
DeviceDao deviceDao;
|
DeviceDao deviceDao;
|
||||||
OrderDao orderDao;
|
OrderDao orderDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public StuUploadController(StuDao stuDao,OrderDao orderDao,DeviceDao deviceDao) {
|
public StuUploadController(StuDao stuDao, OrderDao orderDao, DeviceDao deviceDao) {
|
||||||
this.stuDao = stuDao;
|
this.stuDao = stuDao;
|
||||||
this.orderDao = orderDao;
|
this.orderDao = orderDao;
|
||||||
this.deviceDao = deviceDao;
|
this.deviceDao = deviceDao;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @RequestMapping("/stu/upload")
|
@RequestMapping("/stu/upload.do")
|
||||||
// public String consult(HttpServletRequest request) {
|
public String upload(int deviceTypeId, int deviceAddressId, HttpServletRequest request) {
|
||||||
// request.setAttribute("devices", deviceDao.findAllDevice());
|
ArrayList<Device> deviceList = deviceDao.findAllDevice(deviceTypeId, deviceAddressId, 0);
|
||||||
//
|
if (deviceList.isEmpty()) {
|
||||||
// return "/stu/upload";
|
request.setAttribute("stuUploadMess", "没有查询到设备信息");
|
||||||
//
|
} else {
|
||||||
// }
|
request.setAttribute("deviceTypeId", deviceTypeId);
|
||||||
|
request.setAttribute("deviceAddressId", deviceAddressId);
|
||||||
@PostMapping("/upload.do")
|
|
||||||
public String upload(Order order, @SessionAttribute Stu stu, HttpServletRequest request){
|
|
||||||
order.setStudentId(stu.getUserid());
|
|
||||||
order.setStudentId(0);
|
|
||||||
|
|
||||||
int is = orderDao.add(order);
|
|
||||||
if(is==1){
|
|
||||||
request.setAttribute("stuUploadMess","上传成功");
|
|
||||||
}else{
|
|
||||||
request.setAttribute("stuUploadMess","上传失败");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return "/stu/success";
|
return "/stu/upload";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/stu/upload1.do")
|
||||||
|
public String upload1(
|
||||||
|
@SessionAttribute Stu stu,
|
||||||
|
int deviceId,
|
||||||
|
String address,
|
||||||
|
String faultDesc,
|
||||||
|
String contact,
|
||||||
|
String phone,
|
||||||
|
MultipartFile[] myfile,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
Device device = deviceDao.findDevice(deviceId);
|
||||||
|
if (device == null || device.getDeviceStatus() != DeviceStatus.OK.value) {
|
||||||
|
req.setAttribute("stuUploadMess", "设备不存在或设备已被其他人报修");
|
||||||
|
return "/stu/upload";
|
||||||
|
}
|
||||||
|
Order order = new Order();
|
||||||
|
order.setDeviceId(deviceId);
|
||||||
|
order.setStudentId(stu.getUserid());
|
||||||
|
order.setAddress(address);
|
||||||
|
order.setFaultDesc(faultDesc);
|
||||||
|
order.setContact(contact);
|
||||||
|
order.setPhone(phone);
|
||||||
|
order.setOrderStatus(OrderStatus.UNASSIGNED.value);
|
||||||
|
|
||||||
|
String path2 = "/upload/" + stu.getUserNo() + "/";
|
||||||
|
String path = req.getServletContext().getRealPath(path2);
|
||||||
|
File file = new File(path);
|
||||||
|
if (!file.exists()) {
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
long time = System.currentTimeMillis();
|
||||||
|
ArrayList<String> filepaths = new ArrayList<>();
|
||||||
|
if (myfile != null) {
|
||||||
|
for (int i = 0; i < myfile.length; i++) {
|
||||||
|
String filepath = saveFile(myfile[i], path, path2, time + "", i);
|
||||||
|
if ("图片格式不正确".equals(filepath)) {
|
||||||
|
req.setAttribute("stuUploadMess", "图片格式不正确");
|
||||||
|
return "/stu/upload";
|
||||||
|
} else {
|
||||||
|
filepaths.add(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
order.setFaultImgArray(filepaths);
|
||||||
|
int result = orderDao.add(order);
|
||||||
|
if (result > 0) {
|
||||||
|
req.setAttribute("stuUploadMess", "创建维修单成功");
|
||||||
|
} else {
|
||||||
|
req.setAttribute("stuUploadMess", "创建维修单失败");
|
||||||
|
}
|
||||||
|
return "/stu/upload";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String saveFile(MultipartFile myfile, String path, String path2, String time, int i) {
|
||||||
|
String filename = myfile.getOriginalFilename();
|
||||||
|
String filePath = path + time + "_" + i;
|
||||||
|
String filePath2 = path2 + time + "_" + i;
|
||||||
|
if (filename != null && (filename.endsWith(".jpg") || filename.endsWith(".JPG"))) {
|
||||||
|
filePath += ".jpg";
|
||||||
|
filePath2 += ".jpg";
|
||||||
|
} else if (filename != null && (filename.endsWith(".png") || filename.endsWith(".PNG"))) {
|
||||||
|
filePath += ".png";
|
||||||
|
filePath2 += ".png";
|
||||||
|
} else {
|
||||||
|
return "图片格式不正确";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
myfile.transferTo(new File(filePath));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return filePath2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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";
|
||||||
|
@ -13,4 +13,6 @@ public interface DeviceDao {
|
|||||||
|
|
||||||
ArrayList<Device> findAllDevice(int deviceTypeId, int deviceAddressId, int deviceStatus);
|
ArrayList<Device> findAllDevice(int deviceTypeId, int deviceAddressId, int deviceStatus);
|
||||||
|
|
||||||
|
Device findDevice(int deviceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ public interface OrderDao {
|
|||||||
|
|
||||||
int add(Order order);
|
int add(Order order);
|
||||||
ArrayList<Order> findByStudent_id(int stuId);
|
ArrayList<Order> findByStudent_id(int stuId);
|
||||||
|
ArrayList<Order> findCurrent(int stuId);
|
||||||
ArrayList<Order> findByWorkerId(int workerId);
|
ArrayList<Order> findByWorkerId(int workerId);
|
||||||
|
|
||||||
public int statusModify(int orderId);
|
public int statusModify(int orderId);
|
||||||
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
@ -37,4 +37,11 @@ public class DeviceDaoImpl implements DeviceDao {
|
|||||||
}
|
}
|
||||||
return (ArrayList<Device>) mapper.selectListByQuery(qw);
|
return (ArrayList<Device>) mapper.selectListByQuery(qw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Device findDevice(int deviceId) {
|
||||||
|
QueryWrapper qw = new QueryWrapper();
|
||||||
|
qw.where(DEVICE.DEVICE_ID.eq(deviceId));
|
||||||
|
return mapper.selectOneByQuery(qw);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ 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.OrderStatus;
|
||||||
import cn.edu.cqwu.repair.entity.Worker;
|
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;
|
||||||
@ -34,6 +35,15 @@ public class OrderDaoImpl implements OrderDao {
|
|||||||
return (ArrayList<Order>) mapper.selectListByQuery(qw);
|
return (ArrayList<Order>) mapper.selectListByQuery(qw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrayList<Order> findCurrent(int stuId) {
|
||||||
|
QueryWrapper qw = new QueryWrapper();
|
||||||
|
qw.select(ORDER.ALL_COLUMNS)
|
||||||
|
.where(ORDER.STUDENT_ID.eq(stuId))
|
||||||
|
.where(ORDER.ORDER_STATUS.in(OrderStatus.getCurrent()));
|
||||||
|
return (ArrayList<Order>) mapper.selectListByQuery(qw);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<Order> findByWorkerId(int workerId){
|
public ArrayList<Order> findByWorkerId(int workerId){
|
||||||
QueryWrapper qw = new QueryWrapper();
|
QueryWrapper qw = new QueryWrapper();
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
15
src/main/java/cn/edu/cqwu/repair/entity/DeviceStatus.java
Normal file
15
src/main/java/cn/edu/cqwu/repair/entity/DeviceStatus.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package cn.edu.cqwu.repair.entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xtao
|
||||||
|
*/
|
||||||
|
public enum DeviceStatus {
|
||||||
|
OK(0),
|
||||||
|
REPAIR(1);
|
||||||
|
|
||||||
|
public final int value;
|
||||||
|
|
||||||
|
DeviceStatus(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
@ -1,80 +0,0 @@
|
|||||||
package cn.edu.cqwu.repair.entity;
|
|
||||||
|
|
||||||
import com.mybatisflex.annotation.Column;
|
|
||||||
import com.mybatisflex.annotation.Id;
|
|
||||||
import com.mybatisflex.annotation.KeyType;
|
|
||||||
import com.mybatisflex.annotation.Table;
|
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author xtaod
|
|
||||||
*/
|
|
||||||
@Table(value = "material", dataSource = "repair")
|
|
||||||
public class Material {
|
|
||||||
// 材料 id
|
|
||||||
@Id(keyType = KeyType.Auto)
|
|
||||||
private int materialId;
|
|
||||||
// 材料名称
|
|
||||||
private String materialName;
|
|
||||||
// 材料数量
|
|
||||||
private int materialNum;
|
|
||||||
|
|
||||||
// 创建时间
|
|
||||||
@Column(onInsertValue = "now()")
|
|
||||||
private Timestamp createTime;
|
|
||||||
// 更新时间
|
|
||||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
|
||||||
private Timestamp updateTime;
|
|
||||||
|
|
||||||
public int getMaterialId() {
|
|
||||||
return materialId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaterialId(int materialId) {
|
|
||||||
this.materialId = materialId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMaterialName() {
|
|
||||||
return materialName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaterialName(String materialName) {
|
|
||||||
this.materialName = materialName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaterialNum() {
|
|
||||||
return materialNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaterialNum(int materialNum) {
|
|
||||||
this.materialNum = materialNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Timestamp getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(Timestamp createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Timestamp getUpdateTime() {
|
|
||||||
return updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdateTime(Timestamp updateTime) {
|
|
||||||
this.updateTime = updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Material{" +
|
|
||||||
"materialId=" + materialId +
|
|
||||||
", materialName='" + materialName + '\'' +
|
|
||||||
", materialNum=" + materialNum +
|
|
||||||
", createTime=" + createTime +
|
|
||||||
", updateTime=" + updateTime +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,6 +6,7 @@ import com.mybatisflex.annotation.KeyType;
|
|||||||
import com.mybatisflex.annotation.Table;
|
import com.mybatisflex.annotation.Table;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xtaod
|
* @author xtaod
|
||||||
@ -33,7 +34,9 @@ public class Order {
|
|||||||
// 故障图片
|
// 故障图片
|
||||||
private String faultImg;
|
private String faultImg;
|
||||||
|
|
||||||
// 订单状态 0 表示未分配 1 表示分配、进行中 2 表示已完成
|
// 评分
|
||||||
|
private int score;
|
||||||
|
// 订单状态 0 表示未分配 1 表示分配、进行中 2 表示已完成,未评价 3 表示已评价,已完成
|
||||||
private int orderStatus;
|
private int orderStatus;
|
||||||
// 订单创建时间
|
// 订单创建时间
|
||||||
@Column(onInsertValue = "now()")
|
@Column(onInsertValue = "now()")
|
||||||
@ -113,6 +116,35 @@ public class Order {
|
|||||||
this.faultImg = faultImg;
|
this.faultImg = faultImg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getFaultImgArray() {
|
||||||
|
String imgs = getFaultImg();
|
||||||
|
// 使用 , 分割图片地址
|
||||||
|
String[] imgArray = imgs.split(",");
|
||||||
|
ArrayList<String> imgList = new ArrayList<>();
|
||||||
|
for (String img : imgArray) {
|
||||||
|
if (!img.isEmpty()) {
|
||||||
|
imgList.add(img);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return imgList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFaultImgArray(ArrayList<String> imgList) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (String img : imgList) {
|
||||||
|
sb.append(img).append(",");
|
||||||
|
}
|
||||||
|
setFaultImg(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getScore() {
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScore(int score) {
|
||||||
|
this.score = score;
|
||||||
|
}
|
||||||
|
|
||||||
public int getOrderStatus() {
|
public int getOrderStatus() {
|
||||||
return orderStatus;
|
return orderStatus;
|
||||||
}
|
}
|
||||||
@ -149,6 +181,7 @@ public class Order {
|
|||||||
", address='" + address + '\'' +
|
", address='" + address + '\'' +
|
||||||
", faultDesc='" + faultDesc + '\'' +
|
", faultDesc='" + faultDesc + '\'' +
|
||||||
", faultImg='" + faultImg + '\'' +
|
", faultImg='" + faultImg + '\'' +
|
||||||
|
", score=" + score +
|
||||||
", orderStatus=" + orderStatus +
|
", orderStatus=" + orderStatus +
|
||||||
", createTime=" + createTime +
|
", createTime=" + createTime +
|
||||||
", finishTime=" + finishTime +
|
", finishTime=" + finishTime +
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
package cn.edu.cqwu.repair.entity;
|
package cn.edu.cqwu.repair.entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wobeitaoleshigexuruo
|
||||||
|
*/
|
||||||
|
|
||||||
public enum OrderStatus {
|
public enum OrderStatus {
|
||||||
UNASSIGNED(0),
|
UNASSIGNED(0),
|
||||||
PROGRESS(1),
|
PROGRESS(1),
|
||||||
FINISHED(2);
|
FINISHED(2),
|
||||||
|
SCORED(3);
|
||||||
|
|
||||||
public int value;
|
public final int value;
|
||||||
|
|
||||||
OrderStatus(int value) {
|
OrderStatus(int value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int[] getCurrent() {
|
||||||
|
return new int[]{0, 1, 2};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ public class Stu {
|
|||||||
private String userNo; //学工号
|
private String userNo; //学工号
|
||||||
private String username; //用户名
|
private String username; //用户名
|
||||||
private String password; //密码
|
private String password; //密码
|
||||||
|
// 头像
|
||||||
|
private String photo;
|
||||||
// 性别
|
// 性别
|
||||||
private String gender;
|
private String gender;
|
||||||
private String regip; //注册IP
|
private String regip; //注册IP
|
||||||
@ -61,6 +63,14 @@ public class Stu {
|
|||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPhoto() {
|
||||||
|
return photo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhoto(String photo) {
|
||||||
|
this.photo = photo;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGender() {
|
public String getGender() {
|
||||||
return gender;
|
return gender;
|
||||||
}
|
}
|
||||||
@ -108,6 +118,7 @@ public class Stu {
|
|||||||
", userNo='" + userNo + '\'' +
|
", userNo='" + userNo + '\'' +
|
||||||
", username='" + username + '\'' +
|
", username='" + username + '\'' +
|
||||||
", password='" + password + '\'' +
|
", password='" + password + '\'' +
|
||||||
|
", photo='" + photo + '\'' +
|
||||||
", gender='" + gender + '\'' +
|
", gender='" + gender + '\'' +
|
||||||
", regip='" + regip + '\'' +
|
", regip='" + regip + '\'' +
|
||||||
", status=" + status +
|
", status=" + status +
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
package cn.edu.cqwu.repair.entity.mapper;
|
|
||||||
|
|
||||||
import cn.edu.cqwu.repair.entity.Material;
|
|
||||||
import com.mybatisflex.core.BaseMapper;
|
|
||||||
|
|
||||||
public interface MaterialMapper extends BaseMapper<Material> {
|
|
||||||
}
|
|
@ -17,8 +17,14 @@
|
|||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<a href="#" class="d-flex align-items-center link-body-emphasis text-decoration-none dropdown-toggle"
|
<a href="#" class="d-flex align-items-center link-body-emphasis text-decoration-none dropdown-toggle"
|
||||||
data-bs-toggle="dropdown" aria-expanded="false">
|
data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<img src="${webroot}/images/logo.jpg" alt="" width="32" height="32"
|
<c:if test="${not empty sessionScope.stu.photo}">
|
||||||
class="rounded-circle me-2">
|
<img src="${webroot}${sessionScope.stu.photo}" alt="" width="32" height="32"
|
||||||
|
class="rounded-circle me-2">
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${empty sessionScope.stu.photo}">
|
||||||
|
<img src="${webroot}/images/logo.jpg" alt="" width="32" height="32"
|
||||||
|
class="rounded-circle me-2">
|
||||||
|
</c:if>
|
||||||
<strong>${sessionScope.stu.username}</strong>
|
<strong>${sessionScope.stu.username}</strong>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu text-small shadow">
|
<ul class="dropdown-menu text-small shadow">
|
||||||
|
@ -21,22 +21,22 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="${webroot}/stu/data.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/stu/data.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 个人资料
|
>> 个人资料修改
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="${webroot}/stu/upload.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/stu/upload.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 上传订单
|
>> 创建维修单
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="${webroot}/stu/current" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/stu/current.do" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 当前订单
|
>> 未完成维修单
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="${webroot}/stu/consult" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/stu/consult.do" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 历史订单
|
>> 历史维修单
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</c:when>
|
</c:when>
|
||||||
@ -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>
|
||||||
@ -121,6 +110,12 @@
|
|||||||
<a href="${webroot}/" class="nav-link link-body-emphasis" aria-current="page">
|
<a href="${webroot}/" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
>> 主页
|
>> 主页
|
||||||
</a>
|
</a>
|
||||||
|
<a href="${webroot}/worker_login.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
|
>> 维修人员登录
|
||||||
|
</a>
|
||||||
|
<a href="${webroot}/manage.jsp" class="nav-link link-body-emphasis" aria-current="page">
|
||||||
|
>> 管理员登录
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
|
25
src/main/webapp/js/upload.js
Normal file
25
src/main/webapp/js/upload.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
function addFile() {
|
||||||
|
const fileDiv = document.querySelector("#fileDiv");
|
||||||
|
|
||||||
|
const inputDiv = document.createElement("input");
|
||||||
|
inputDiv.setAttribute("class", "form-control form-control-lg");
|
||||||
|
inputDiv.type = "file";
|
||||||
|
inputDiv.name = "myfile";
|
||||||
|
inputDiv.required = true;
|
||||||
|
inputDiv.id = "file" + fileDiv.children.length;
|
||||||
|
|
||||||
|
const br = document.createElement("br");
|
||||||
|
|
||||||
|
const div = document.createElement("div");
|
||||||
|
div.appendChild(inputDiv);
|
||||||
|
div.appendChild(br);
|
||||||
|
|
||||||
|
fileDiv.appendChild(div);
|
||||||
|
}
|
||||||
|
|
||||||
|
function delFile() {
|
||||||
|
const fileDiv = document.querySelector("#fileDiv");
|
||||||
|
if (fileDiv.children.length > 0) {
|
||||||
|
fileDiv.removeChild(fileDiv.lastChild);
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@
|
|||||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
<c:set var="title" value="上传表单"/>
|
<c:set var="title" value="历史维修单"/>
|
||||||
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
||||||
<c:set var="repairOrder" value="${requestScope.Orders}"/>
|
<c:set var="repairOrder" value="${requestScope.Orders}"/>
|
||||||
<html>
|
<html>
|
||||||
@ -23,31 +23,28 @@
|
|||||||
<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">
|
<main class="form-signin w-100 m-auto scrollspy" style="min-width: 800px">
|
||||||
|
|
||||||
<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">${title}</h1>
|
||||||
<c:if test="${not empty requestScope.stuConsultMess}">
|
<c:if test="${not empty requestScope.stuConsultMess}">
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
${requestScope.stuConsultMess}
|
${requestScope.stuConsultMess}
|
||||||
</div>
|
</div>
|
||||||
</c:if>
|
</c:if>
|
||||||
<div class="form-floating">
|
<table class="table">
|
||||||
|
<thead>
|
||||||
<c:if test="${not empty requestScope.Orders}">
|
<tr>
|
||||||
<table class="table">
|
<th scope="col">序号</th>
|
||||||
<thead>
|
<th scope="col">联系人名称</th>
|
||||||
<tr>
|
<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>
|
||||||
<th scope="col">故障图片</th>
|
</thead>
|
||||||
<th scope="col">处理状态</th>
|
<tbody>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<c:forEach var="repairOrder" items="${requestScope.Orders}" varStatus="loop">
|
<c:forEach var="repairOrder" items="${requestScope.Orders}" varStatus="loop">
|
||||||
<tr>
|
<tr>
|
||||||
<td>${loop.index + 1}</td>
|
<td>${loop.index + 1}</td>
|
||||||
@ -55,7 +52,6 @@
|
|||||||
<td>${repairOrder.phone}</td>
|
<td>${repairOrder.phone}</td>
|
||||||
<td>${repairOrder.address}</td>
|
<td>${repairOrder.address}</td>
|
||||||
<td>${repairOrder.faultDesc}</td>
|
<td>${repairOrder.faultDesc}</td>
|
||||||
<td><img src="${repairOrder.faultImg}" alt="故障图片"></td>
|
|
||||||
<td>
|
<td>
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${repairOrder.orderStatus==0}">
|
<c:when test="${repairOrder.orderStatus==0}">
|
||||||
@ -64,30 +60,22 @@
|
|||||||
<c:when test="${repairOrder.orderStatus==1}">
|
<c:when test="${repairOrder.orderStatus==1}">
|
||||||
正在维修中
|
正在维修中
|
||||||
</c:when>
|
</c:when>
|
||||||
|
<c:when test="${repairOrder.orderStatus==2}">
|
||||||
|
等待评价
|
||||||
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
维修已完成
|
维修已完成
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="${webroot}/stu/detail.do?id=${repairOrder.orderId}">详情</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</c:if>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
<%--<script src="${webroot}/js/pass.js" type="javascript"></script>--%>
|
|
||||||
<%--<script>--%>
|
|
||||||
<%-- const toastLiveExample = document.getElementById('liveToast')--%>
|
|
||||||
|
|
||||||
<%-- const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastLiveExample)--%>
|
|
||||||
<%-- toastBootstrap.show()--%>
|
|
||||||
<%--</script>--%>
|
|
||||||
<%--<script src="${webroot}/js/pass.js"></script>--%>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
<c:set var="title" value="上传表单"/>
|
<c:set var="title" value="当前维修单"/>
|
||||||
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
||||||
<c:set var="repairOrder" value="${requestScope.Orders}"/>
|
<c:set var="repairOrder" value="${requestScope.Orders}"/>
|
||||||
<html>
|
<html>
|
||||||
@ -30,44 +30,38 @@
|
|||||||
<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">
|
<main class="form-signin w-100 m-auto scrollspy" style="min-width: 800px">
|
||||||
|
|
||||||
<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">${title}</h1>
|
||||||
|
|
||||||
<c:if test="${not empty requestScope.stuCurrentMess}">
|
<c:if test="${not empty requestScope.stuCurrentMess}">
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
${requestScope.stuCurrentMess}
|
${requestScope.stuCurrentMess}
|
||||||
</div>
|
</div>
|
||||||
</c:if>
|
</c:if>
|
||||||
<div class="form-floating">
|
|
||||||
|
|
||||||
<c:if test="${not empty requestScope.Orders}">
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">序号</th>
|
||||||
<table class="table">
|
<th scope="col">联系人名称</th>
|
||||||
<thead>
|
<th scope="col">联系人电话</th>
|
||||||
|
<th scope="col">详细地点</th>
|
||||||
|
<th scope="col">故障描述</th>
|
||||||
|
<th scope="col">处理状态</th>
|
||||||
|
<th scope="col">操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<c:forEach var="repairOrder" items="${requestScope.Orders}" varStatus="loop">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">序号</th>
|
<td>${loop.index + 1}</td>
|
||||||
<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>
|
|
||||||
<c:forEach var="repairOrder" items="${requestScope.Orders}" varStatus="loop">
|
|
||||||
<tr>
|
|
||||||
<th scope="row">${loop.index + 1}</th>
|
|
||||||
<td>${repairOrder.contact}</td>
|
<td>${repairOrder.contact}</td>
|
||||||
<td>${repairOrder.phone}</td>
|
<td>${repairOrder.phone}</td>
|
||||||
<td>${repairOrder.address}</td>
|
<td>${repairOrder.address}</td>
|
||||||
<td>${repairOrder.faultDesc}</td>
|
<td>${repairOrder.faultDesc}</td>
|
||||||
<td><img src="${repairOrder.faultImg}" alt="故障图片"></td>
|
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${repairOrder.orderStatus==0}">
|
<c:when test="${repairOrder.orderStatus==0}">
|
||||||
待安排维修人员
|
待安排维修人员
|
||||||
@ -75,25 +69,20 @@
|
|||||||
<c:when test="${repairOrder.orderStatus==1}">
|
<c:when test="${repairOrder.orderStatus==1}">
|
||||||
正在维修中
|
正在维修中
|
||||||
</c:when>
|
</c:when>
|
||||||
|
<c:when test="${repairOrder.orderStatus==2}">
|
||||||
|
等待评价
|
||||||
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
维修已完成
|
维修已完成
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="${webroot}/stu/detail.do?id=${repairOrder.orderId}">详情</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</table>
|
||||||
|
|
||||||
</c:forEach>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
@ -24,46 +24,43 @@
|
|||||||
|
|
||||||
<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">
|
<form action="${webroot}/stu/edit.do" method="post" enctype="multipart/form-data">
|
||||||
<h1 class="h3 mb-3 fw-normal">个人资料</h1>
|
<img class="mb-4" src="${webroot}/images/logo.jpg" alt="" width="72" height="72">
|
||||||
<c:if test="${not empty requestScope.stuMess}">
|
<h1 class="h3 mb-3 fw-normal">${title}</h1>
|
||||||
<div class="alert alert-warning" role="alert">
|
|
||||||
${requestScope.stuMess}
|
<c:if test="${not empty requestScope.stuEditMess}">
|
||||||
|
<div class="alert alert-warning" role="alert">
|
||||||
|
${requestScope.stuEditMess}
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="formFileLg" class="form-label">头像</label>
|
||||||
|
<input class="form-control form-control-lg" id="formFileLg" type="file" name="myfile" required>
|
||||||
</div>
|
</div>
|
||||||
</c:if>
|
<br/>
|
||||||
<div class="form-floating">
|
<div class="input-group mb-3">
|
||||||
<form action="stu/data" method="post">
|
<span class="input-group-text">性别</span>
|
||||||
<div class="form-floating">
|
<select class="form-select" name="gender" id="gender" required>
|
||||||
<label for="username">Username:</label><br>
|
|
||||||
<input type="text" id="username" name="username" value="${stu.username}"><br><br>
|
|
||||||
</div>
|
|
||||||
<label for="gender">Gender:</label><br>
|
|
||||||
<div class="form-floating">
|
|
||||||
<select id="gender" name="gender" >
|
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${stu.gender == 'male'}">
|
<c:when test="${stu.gender == 'male'}">
|
||||||
<option value="male" selected>Male</option>
|
<option value="male" selected='selected'>男</option>
|
||||||
<option value="female">Female</option>
|
<option value="female">女</option>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<option value="male">Male</option>
|
<option value="male">男</option>
|
||||||
<option value="female" selected>Female</option>
|
<option value="female" selected='selected'>女</option>
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
|
|
||||||
|
|
||||||
</c:choose>
|
</c:choose>
|
||||||
|
</select>
|
||||||
</select><br><br>
|
</div>
|
||||||
</div>
|
<br/>
|
||||||
<button class="btn btn-primary w-100 py-2" type="submit" id="submit">提交</button>
|
<input class="btn btn-primary w-100 py-2" type="submit" id="submit">
|
||||||
|
<br/><br/>
|
||||||
</form>
|
</form>
|
||||||
|
<img src="${webroot}/upload/${sessionScope.stu.userNo}/photo.jpg" style="height: 150px; width: 150px"
|
||||||
</div>
|
class="img-thumbnail">
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -5,74 +5,134 @@
|
|||||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
<c:set var="title" value="上传表单"/>
|
<c:set var="title" value="新建报修单"/>
|
||||||
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="${webroot}/styles/bootstrap.min.css">
|
<link rel="stylesheet" href="${webroot}/styles/bootstrap.min.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
<title>${title}</title>
|
<title>${title}</title>
|
||||||
<link rel="stylesheet" href="${webroot}/styles/bootstrap.min.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="${webroot}/styles/bootstrap.min.css" crossorigin="anonymous">
|
||||||
<script src="${webroot}/js/bootstrap.bundle.min.js"></script>
|
<script src="${webroot}/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="${webroot}/js/upload.js"></script>
|
||||||
<link rel="stylesheet" href="${webroot}/styles/sidebar.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="${webroot}/styles/sidebar.css" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" href="${webroot}/styles/index.css" crossorigin="anonymous"></head>
|
<link rel="stylesheet" href="${webroot}/styles/index.css" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
<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="form-signin w-100 m-auto">
|
<main class="form-signin w-100 m-auto" style="min-width: 600px">
|
||||||
<form action="${webroot}/upload.do" method="post" >
|
<c:if test="${empty requestScope.deviceTypeId}">
|
||||||
|
<form action="${webroot}/stu/upload.do" method="post" >
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${not empty requestScope.deviceTypeId}">
|
||||||
|
<form action="${webroot}/stu/upload1.do" method="post" enctype="multipart/form-data" id="form">
|
||||||
|
</c:if>
|
||||||
<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">${title}</h1>
|
||||||
|
|
||||||
<c:if test="${not empty requestScope.stuUploadMess}">
|
<c:if test="${not empty requestScope.stuUploadMess}">
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
${requestScope.stuUploadMess}
|
${requestScope.stuUploadMess}
|
||||||
</div>
|
</div>
|
||||||
</c:if>
|
</c:if>
|
||||||
<div class="form-floating">
|
|
||||||
|
|
||||||
<select id="deviceId" name="deviceId">
|
<c:if test="${empty requestScope.deviceTypeId}">
|
||||||
|
|
||||||
|
|
||||||
<%-- 使用 JSP 语法获取 application 中的设备数组 --%>
|
|
||||||
<% ArrayList<Device> devices = (ArrayList<Device>) application.getAttribute("device"); %>
|
|
||||||
|
|
||||||
<%-- 循环遍历设备数组,并将每个设备作为下拉框的选项 --%>
|
|
||||||
<% for (Device device : devices) { %>
|
|
||||||
<option value="<%= device.getDeviceName() %>"><%= device.getDeviceName() %></option>
|
|
||||||
<% } %>
|
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text">报修类型</span>
|
||||||
|
<select class="form-select" name="deviceTypeId" id="deviceTypeId" required>
|
||||||
|
<c:forEach items="${applicationScope.faults}" var="fault">
|
||||||
|
<option value="${fault.faultId}">${fault.faultName}</option>
|
||||||
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-floating">
|
<div class="input-group mb-3">
|
||||||
<input type="text" class="form-control" name="contact" id="contact" required>
|
<span class="input-group-text">报修区域</span>
|
||||||
<label for="contact">联系人名称</label>
|
<select class="form-select" name="deviceAddressId" id="deviceAddressId" required>
|
||||||
|
<c:forEach items="${applicationScope.addresses1}" var="address" varStatus="rows">
|
||||||
|
<c:forEach items="${applicationScope.addresses0}" var="address0" varStatus="rows0">
|
||||||
|
<c:if test="${address0.parentId == address.addressId}">
|
||||||
|
<option value="${address0.addressId}">${address.addressName} - ${address0.addressName}</option>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-floating">
|
</c:if>
|
||||||
<input type="text" class="form-control" name="phone" id="phone" required>
|
<c:if test="${not empty requestScope.deviceTypeId}">
|
||||||
<label for="phone">联系人电话</label>
|
<div class="input-group mb-3">
|
||||||
</div>
|
<span class="input-group-text">报修类型</span>
|
||||||
<div class="form-floating">
|
<select class="form-select" name="deviceTypeId" id="1" required>
|
||||||
<input type="text" class="form-control" name="address" id="address" required>
|
<c:forEach items="${applicationScope.faults}" var="fault">
|
||||||
<label for="address">详细地点</label>
|
<c:if test="${fault.faultId == requestScope.deviceTypeId}">
|
||||||
</div>
|
<option value="${fault.faultId}" selected>${fault.faultName}</option>
|
||||||
<div class="form-floating">
|
</c:if>
|
||||||
<input type="text" class="form-control" name="faultDesc" id="faultDesc" required>
|
</c:forEach>
|
||||||
<label for="faultDesc">故障描述</label>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
|
||||||
<input type="text" class="form-control" name="faultImg" id="faultImg" required>
|
|
||||||
<label for="faultImg">故障图片</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text">报修区域</span>
|
||||||
|
<select class="form-select" name="deviceAddressId" id="2" required>
|
||||||
|
<c:forEach items="${applicationScope.addresses0}" var="address0" varStatus="rows0">
|
||||||
|
<c:if test="${address0.addressId == requestScope.deviceAddressId}">
|
||||||
|
<option value="${address0.addressId}" selected>${address.addressName} - ${address0.addressName}</option>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text">报修设备</span>
|
||||||
|
<select class="form-select" name="deviceId" id="deviceId" required>
|
||||||
|
<c:forEach items="${applicationScope.device}" var="device" varStatus="rows">
|
||||||
|
<c:if test="${device.deviceTypeId == requestScope.deviceTypeId}">
|
||||||
|
<c:if test="${device.deviceAddressId == requestScope.deviceAddressId}">
|
||||||
|
<c:if test="${device.deviceStatus == 0}">
|
||||||
|
<option value="${device.deviceId}">${device.deviceName}</option>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text">详细地点</span>
|
||||||
|
<input type="text" class="form-control" name="address" id="address" value="${requestScope.reginfo.sname}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text">问题描述</span>
|
||||||
|
<input type="text" class="form-control" name="faultDesc" id="faultDesc" value="${requestScope.reginfo.sname}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text">联系人姓名</span>
|
||||||
|
<input type="text" class="form-control" name="contact" id="contact" value="${requestScope.reginfo.sname}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text">联系人电话</span>
|
||||||
|
<input type="text" class="form-control" name="phone" id="phone" value="${requestScope.reginfo.sname}"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="fileDiv">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="button" class="btn btn-primary w-100 py-2" onclick="addFile()" value="添加图片">
|
||||||
|
<br/><br/>
|
||||||
|
<input type="button" class="btn btn-primary w-100 py-2" onclick="delFile()" value="删除图片">
|
||||||
|
<br/><br/>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
<button class="btn btn-primary w-100 py-2" type="submit" id="submit">提交</button>
|
<button class="btn btn-primary w-100 py-2" type="submit" id="submit">提交</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
@ -81,15 +141,5 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
<script src="${webroot}/js/pass.js" type="javascript"></script>
|
|
||||||
<script>
|
|
||||||
const toastLiveExample = document.getElementById('liveToast')
|
|
||||||
|
|
||||||
const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastLiveExample)
|
|
||||||
toastBootstrap.show()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
0
src/main/webapp/upload/.gitkeep
Normal file
0
src/main/webapp/upload/.gitkeep
Normal file
@ -18,54 +18,42 @@
|
|||||||
<title>${title}</title>
|
<title>${title}</title>
|
||||||
<link rel="stylesheet" href="${webroot}/styles/bootstrap.min.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="${webroot}/styles/bootstrap.min.css" crossorigin="anonymous">
|
||||||
<script src="${webroot}/js/bootstrap.bundle.min.js"></script>
|
<script src="${webroot}/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="${webroot}/js/record.js"></script>
|
||||||
<link rel="stylesheet" href="${webroot}/styles/sidebar.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="${webroot}/styles/sidebar.css" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" href="${webroot}/styles/index.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="${webroot}/styles/index.css" crossorigin="anonymous">
|
||||||
</head>
|
</head>
|
||||||
<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>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
<c:set var="title" value="worker_Login"/>
|
<c:set var="title" value="维修人员登录"/>
|
||||||
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<form action="${webroot}/worker/Login.do" method="post" >
|
<form action="${webroot}/worker/Login.do" method="post" >
|
||||||
<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>
|
||||||
|
|
||||||
<c:if test="${not empty requestScope.workerLoginMess}">
|
<c:if test="${not empty requestScope.workerLoginMess}">
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
|
Loading…
Reference in New Issue
Block a user