diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 8d66637..f8fb95b 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,5 +1,60 @@ \ No newline at end of file diff --git a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuConsultController.java b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuConsultController.java index 96fa96c..ef1c9ad 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuConsultController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuConsultController.java @@ -21,19 +21,15 @@ public class StuConsultController { this.orderDao = orderDao; } - @RequestMapping("/stu/consult") + @RequestMapping("/stu/consult.do") public String consult(HttpServletRequest request, @SessionAttribute Stu stu) { ArrayList orders = orderDao.findByStudent_id(stu.getUserid()); - if(orders!=null) { - System.out.println(orders); + if (orders != null) { request.setAttribute("Orders", orders); - }else{ - System.out.println("订单空"); - request.setAttribute("stuConsultMess","订单为空"); + } else { + request.setAttribute("stuConsultMess", "订单为空"); } return "/stu/consult"; } - - } diff --git a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuCurrentController.java b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuCurrentController.java index e06f8d5..2bca1a4 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuCurrentController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuCurrentController.java @@ -3,11 +3,11 @@ package cn.edu.cqwu.repair.controller.stu; import cn.edu.cqwu.repair.dao.OrderDao; import cn.edu.cqwu.repair.entity.Order; -import cn.edu.cqwu.repair.entity.OrderStatus; import cn.edu.cqwu.repair.entity.Stu; import org.springframework.beans.factory.annotation.Autowired; 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 java.util.ArrayList; @@ -21,30 +21,15 @@ public class StuCurrentController { public StuCurrentController(OrderDao orderDao) { this.orderDao = orderDao; } - @GetMapping("/stu/current") + + @GetMapping("/stu/current.do") public String current(HttpServletRequest request, @SessionAttribute Stu stu) { - ArrayList orders = orderDao.findByStudent_id(stu.getUserid()); - ArrayList orders1 = new ArrayList<>(); - for (Order order : orders) { - if(order.getOrderStatus()== OrderStatus.UNASSIGNED.value|| order.getOrderStatus()==OrderStatus.PROGRESS.value){ - - orders1.add(order); - - } - } - if(orders1!=null) { - System.out.println(orders1); - request.setAttribute("Orders", orders1); - }else{ - System.out.println("订单空"); - request.setAttribute("stuCurrentMess","订单为空"); + ArrayList orders = orderDao.findCurrent(stu.getUserid()); + if (orders != null) { + request.setAttribute("Orders", orders); + } else { + request.setAttribute("stuCurrentMess", "订单为空"); } return "/stu/current"; - - - } - - - } diff --git a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuDataController.java b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuDataController.java index 21a3c5d..48c9a90 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuDataController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuDataController.java @@ -2,54 +2,60 @@ package cn.edu.cqwu.repair.controller.stu; import cn.edu.cqwu.repair.dao.StuDao; 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.http.HttpRequest; 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.SessionAttribute; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; +import java.io.File; +/** + * @author xtaod + */ @Controller - public class StuDataController { -StuDao stuDao; + StuDao stuDao; + @Autowired public StuDataController(StuDao stuDao) { this.stuDao = stuDao; } -// @RequestMapping(value = "/stu/data") -// public String stuData( ) { -// return "stu/data"; -// } - - @PostMapping("stu/data") - public String stuData(@Param("username")String username, @Param("gender")String gender, HttpServletRequest req){ - Stu stu = new Stu(); - Stu stu1 = (Stu)req.getSession().getAttribute("stu"); - - stu.setUsername(username); - stu.setGender(gender); - stu.setPassword(stu1.getPassword()); - stu.setUserid(stu1.getUserid()); - stu.setRegip(stu1.getRegip()); - stu.setStatus(stu1.getStatus()); - stu.setRegtime(stu1.getRegtime()); - stu.setUpdateTime(stu1.getUpdateTime()); - stu.setUserNo(stu1.getUserNo()); - int update = stuDao.update(stu); - if(update>0){ - req.setAttribute("stuMess", "修改成功"); - - }else{ - req.setAttribute("stuMess", "修改失败"); + @RequestMapping("/stu/edit.do") + public String stuData(@SessionAttribute Stu stu, MultipartFile myfile, String gender, HttpServletRequest req) { + String path = req.getServletContext().getRealPath("/upload/" + stu.getUserNo() + "/"); + File file = new File(path); + if (!file.exists()) { + file.mkdirs(); + } + String filename = myfile.getOriginalFilename(); + if (filename != null && (filename.endsWith(".jpg") || filename.endsWith(".JPG"))) { + try { + myfile.transferTo(new File(path + "/photo.jpg")); + } catch (Exception e) { + e.printStackTrace(); + } + stu.setPhoto("/upload/" + stu.getUserNo() + "/photo.jpg"); + } else { + req.setAttribute("stuEditMess", "图片格式不正确"); + return "/stu/data"; } - 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"; } } diff --git a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuUploadController.java b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuUploadController.java index c1d5f61..83040e2 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/stu/StuUploadController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/stu/StuUploadController.java @@ -1,58 +1,119 @@ - - package cn.edu.cqwu.repair.controller.stu; import cn.edu.cqwu.repair.dao.DeviceDao; import cn.edu.cqwu.repair.dao.OrderDao; import cn.edu.cqwu.repair.dao.StuDao; -import cn.edu.cqwu.repair.entity.Order; -import cn.edu.cqwu.repair.entity.Stu; +import cn.edu.cqwu.repair.entity.*; import org.springframework.beans.factory.annotation.Autowired; 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.SessionAttribute; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.util.ArrayList; +/** + * @author xtaod + */ @Controller public class StuUploadController { StuDao stuDao; -DeviceDao deviceDao; + DeviceDao deviceDao; OrderDao orderDao; + @Autowired - public StuUploadController(StuDao stuDao,OrderDao orderDao,DeviceDao deviceDao) { + public StuUploadController(StuDao stuDao, OrderDao orderDao, DeviceDao deviceDao) { this.stuDao = stuDao; this.orderDao = orderDao; this.deviceDao = deviceDao; } -// @RequestMapping("/stu/upload") -// public String consult(HttpServletRequest request) { -// request.setAttribute("devices", deviceDao.findAllDevice()); -// -// return "/stu/upload"; -// -// } - - @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","上传失败"); - + @RequestMapping("/stu/upload.do") + public String upload(int deviceTypeId, int deviceAddressId, HttpServletRequest request) { + ArrayList deviceList = deviceDao.findAllDevice(deviceTypeId, deviceAddressId, 0); + if (deviceList.isEmpty()) { + request.setAttribute("stuUploadMess", "没有查询到设备信息"); + } else { + request.setAttribute("deviceTypeId", deviceTypeId); + request.setAttribute("deviceAddressId", deviceAddressId); } - 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 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; + } } diff --git a/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryLoginController.java b/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryLoginController.java index c92d0e1..3f1a251 100644 --- a/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryLoginController.java +++ b/src/main/java/cn/edu/cqwu/repair/controller/worker/WorkerHistoryLoginController.java @@ -1,17 +1,16 @@ package cn.edu.cqwu.repair.controller.worker; 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.util.PageModel; 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.SessionAttribute; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.util.List; /** * @author sobear @@ -26,18 +25,19 @@ public class WorkerHistoryLoginController extends HttpServlet { } @GetMapping("/worker/HistoryLogin.do") - public String getOrders(Model model, HttpSession session, - HttpServletRequest request) { - // 获取Session对象 - session = request.getSession(); - - // 从Session中获取ID数据 - Worker workerUser = (Worker) session.getAttribute("workerUser"); - // 调用DAO的方法来获取数据库中的历史登录数据 - List records = (List) recordDao.findHistoryRecord(workerUser.getUsername()); - - // 将订单数据添加到Model中,以便在JSP页面中使用 - model.addAttribute("records", records); + public String adminRecord( + @SessionAttribute Worker workerUser, Model model, HttpServletRequest request) { + String pageNoS = request.getParameter("pageNo"); + int pageNo = 1; + try { + pageNo = Integer.parseInt(pageNoS); + } catch (NumberFormatException ignored) { + } + PageModel pm = recordDao.pageByLogname( + workerUser.getUsername(), "工人", 10, pageNo + ); + pm.setPageNav("HistoryLogin.do"); + model.addAttribute("pm", pm); // 返回到展示订单列表的JSP页面 return "/worker/worker_history_loginList"; diff --git a/src/main/java/cn/edu/cqwu/repair/dao/DeviceDao.java b/src/main/java/cn/edu/cqwu/repair/dao/DeviceDao.java index f7cb4f1..9138896 100644 --- a/src/main/java/cn/edu/cqwu/repair/dao/DeviceDao.java +++ b/src/main/java/cn/edu/cqwu/repair/dao/DeviceDao.java @@ -13,4 +13,6 @@ public interface DeviceDao { ArrayList findAllDevice(int deviceTypeId, int deviceAddressId, int deviceStatus); + Device findDevice(int deviceId); + } diff --git a/src/main/java/cn/edu/cqwu/repair/dao/OrderDao.java b/src/main/java/cn/edu/cqwu/repair/dao/OrderDao.java index 40782b7..d38878d 100644 --- a/src/main/java/cn/edu/cqwu/repair/dao/OrderDao.java +++ b/src/main/java/cn/edu/cqwu/repair/dao/OrderDao.java @@ -8,6 +8,7 @@ public interface OrderDao { int add(Order order); ArrayList findByStudent_id(int stuId); + ArrayList findCurrent(int stuId); ArrayList findByWorkerId(int workerId); public int statusModify(int orderId); diff --git a/src/main/java/cn/edu/cqwu/repair/dao/RecordDao.java b/src/main/java/cn/edu/cqwu/repair/dao/RecordDao.java index e881d11..5d74563 100644 --- a/src/main/java/cn/edu/cqwu/repair/dao/RecordDao.java +++ b/src/main/java/cn/edu/cqwu/repair/dao/RecordDao.java @@ -3,12 +3,8 @@ package cn.edu.cqwu.repair.dao; import cn.edu.cqwu.repair.entity.Record; import cn.edu.cqwu.repair.util.PageModel; -import java.util.ArrayList; - public interface RecordDao { int add(Record record); PageModel pageByLogname(String logname, String group, int pageSize, int pageNo); - - public ArrayList findHistoryRecord(String workername); } diff --git a/src/main/java/cn/edu/cqwu/repair/dao/impl/DeviceDaoImpl.java b/src/main/java/cn/edu/cqwu/repair/dao/impl/DeviceDaoImpl.java index 7056a28..1afd973 100644 --- a/src/main/java/cn/edu/cqwu/repair/dao/impl/DeviceDaoImpl.java +++ b/src/main/java/cn/edu/cqwu/repair/dao/impl/DeviceDaoImpl.java @@ -37,4 +37,11 @@ public class DeviceDaoImpl implements DeviceDao { } return (ArrayList) mapper.selectListByQuery(qw); } + + @Override + public Device findDevice(int deviceId) { + QueryWrapper qw = new QueryWrapper(); + qw.where(DEVICE.DEVICE_ID.eq(deviceId)); + return mapper.selectOneByQuery(qw); + } } diff --git a/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java b/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java index 313e9ba..2a1c61a 100644 --- a/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java +++ b/src/main/java/cn/edu/cqwu/repair/dao/impl/OrderDaoImpl.java @@ -3,6 +3,7 @@ package cn.edu.cqwu.repair.dao.impl; import cn.edu.cqwu.repair.dao.OrderDao; import cn.edu.cqwu.repair.db.ConnectionFactory; 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.mapper.DeviceMapper; import cn.edu.cqwu.repair.entity.mapper.OrderMapper; @@ -34,6 +35,15 @@ public class OrderDaoImpl implements OrderDao { return (ArrayList) mapper.selectListByQuery(qw); } + @Override + public ArrayList 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) mapper.selectListByQuery(qw); + } + @Override public ArrayList findByWorkerId(int workerId){ QueryWrapper qw = new QueryWrapper(); diff --git a/src/main/java/cn/edu/cqwu/repair/dao/impl/RecordDaoImpl.java b/src/main/java/cn/edu/cqwu/repair/dao/impl/RecordDaoImpl.java index 6f3e89d..b4791f6 100644 --- a/src/main/java/cn/edu/cqwu/repair/dao/impl/RecordDaoImpl.java +++ b/src/main/java/cn/edu/cqwu/repair/dao/impl/RecordDaoImpl.java @@ -36,11 +36,4 @@ public class RecordDaoImpl implements RecordDao { List recordsList = mapper.selectListByQuery(qw); return new PageModel(pageSize, pageNo, recordsList); } - - @Override - public ArrayList findHistoryRecord(String workername){ - QueryWrapper qw = new QueryWrapper(); - qw.select(RECORD.ALL_COLUMNS).where(RECORD.LOGNAME.eq(workername)); - return (ArrayList) mapper.selectListByQuery(qw); - } } diff --git a/src/main/java/cn/edu/cqwu/repair/entity/DeviceStatus.java b/src/main/java/cn/edu/cqwu/repair/entity/DeviceStatus.java new file mode 100644 index 0000000..c1f4c67 --- /dev/null +++ b/src/main/java/cn/edu/cqwu/repair/entity/DeviceStatus.java @@ -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; + } +} diff --git a/src/main/java/cn/edu/cqwu/repair/entity/Material.java b/src/main/java/cn/edu/cqwu/repair/entity/Material.java deleted file mode 100644 index e652d8a..0000000 --- a/src/main/java/cn/edu/cqwu/repair/entity/Material.java +++ /dev/null @@ -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 + - '}'; - } -} diff --git a/src/main/java/cn/edu/cqwu/repair/entity/Order.java b/src/main/java/cn/edu/cqwu/repair/entity/Order.java index 4e50db6..6adf172 100644 --- a/src/main/java/cn/edu/cqwu/repair/entity/Order.java +++ b/src/main/java/cn/edu/cqwu/repair/entity/Order.java @@ -6,6 +6,7 @@ import com.mybatisflex.annotation.KeyType; import com.mybatisflex.annotation.Table; import java.sql.Timestamp; +import java.util.ArrayList; /** * @author xtaod @@ -33,7 +34,9 @@ public class Order { // 故障图片 private String faultImg; - // 订单状态 0 表示未分配 1 表示分配、进行中 2 表示已完成 + // 评分 + private int score; + // 订单状态 0 表示未分配 1 表示分配、进行中 2 表示已完成,未评价 3 表示已评价,已完成 private int orderStatus; // 订单创建时间 @Column(onInsertValue = "now()") @@ -113,6 +116,35 @@ public class Order { this.faultImg = faultImg; } + public ArrayList getFaultImgArray() { + String imgs = getFaultImg(); + // 使用 , 分割图片地址 + String[] imgArray = imgs.split(","); + ArrayList imgList = new ArrayList<>(); + for (String img : imgArray) { + if (!img.isEmpty()) { + imgList.add(img); + } + } + return imgList; + } + + public void setFaultImgArray(ArrayList 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() { return orderStatus; } @@ -149,6 +181,7 @@ public class Order { ", address='" + address + '\'' + ", faultDesc='" + faultDesc + '\'' + ", faultImg='" + faultImg + '\'' + + ", score=" + score + ", orderStatus=" + orderStatus + ", createTime=" + createTime + ", finishTime=" + finishTime + diff --git a/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java b/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java index 7696706..7391535 100644 --- a/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java +++ b/src/main/java/cn/edu/cqwu/repair/entity/OrderStatus.java @@ -1,14 +1,22 @@ package cn.edu.cqwu.repair.entity; +/** + * @author wobeitaoleshigexuruo + */ + public enum OrderStatus { UNASSIGNED(0), PROGRESS(1), - FINISHED(2); + FINISHED(2), + SCORED(3); - public int value; + public final int value; OrderStatus(int value) { this.value = value; } + public static int[] getCurrent() { + return new int[]{0, 1, 2}; + } } diff --git a/src/main/java/cn/edu/cqwu/repair/entity/Stu.java b/src/main/java/cn/edu/cqwu/repair/entity/Stu.java index 08308fb..1647ad3 100644 --- a/src/main/java/cn/edu/cqwu/repair/entity/Stu.java +++ b/src/main/java/cn/edu/cqwu/repair/entity/Stu.java @@ -19,6 +19,8 @@ public class Stu { private String userNo; //学工号 private String username; //用户名 private String password; //密码 + // 头像 + private String photo; // 性别 private String gender; private String regip; //注册IP @@ -61,6 +63,14 @@ public class Stu { this.password = password; } + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + public String getGender() { return gender; } @@ -108,6 +118,7 @@ public class Stu { ", userNo='" + userNo + '\'' + ", username='" + username + '\'' + ", password='" + password + '\'' + + ", photo='" + photo + '\'' + ", gender='" + gender + '\'' + ", regip='" + regip + '\'' + ", status=" + status + diff --git a/src/main/java/cn/edu/cqwu/repair/entity/mapper/MaterialMapper.java b/src/main/java/cn/edu/cqwu/repair/entity/mapper/MaterialMapper.java deleted file mode 100644 index 5f3a810..0000000 --- a/src/main/java/cn/edu/cqwu/repair/entity/mapper/MaterialMapper.java +++ /dev/null @@ -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 { -} diff --git a/src/main/webapp/includes/dropdown.jsp b/src/main/webapp/includes/dropdown.jsp index 86782b2..669cd82 100644 --- a/src/main/webapp/includes/dropdown.jsp +++ b/src/main/webapp/includes/dropdown.jsp @@ -17,8 +17,14 @@ -

请先登录

+

维修人员登录