项目描述
该项目 两种角色 用户、管理员:
用户主要功能有:待收列表,收件列表,寄件功能,寄件列表,个人信息修改;
管理员主要功能有:相比于用户多了 物流管理,用户管理;
运行环境
jdk8+mysql5.7+IntelliJ IDEA+maven
项目技术
SpringBoot+MybatisPlus+Thymeleaf+jquery+layui
项目截图
登录
注册
寄件
寄件列表
待收件
收件列表
个人信息
物流管理
用户管理
代码结构
部分代码
/**
* @author GXY
*/
@Controller
public class adminController {
@Autowired
PostService postService;
@Autowired
CategoryService categoryService;
@Autowired
PositionService positionService;
@Autowired
OrdersService ordersService;
@Autowired
UserService userService;
//寄件管理
@GetMapping("/toAdminSend")
public String toAdminSend(@RequestParam(required = false, defaultValue = "1", value = "pageNum") int pageNum, HttpSession session, Model model, RedirectAttributes attributes) {
User userInfo = (User) session.getAttribute("user");
if (userInfo != null) {
PageHelper.startPage(pageNum, 6);
List<Post> postList = postService.findAllPost();
PageInfo<Post> pageInfo = new PageInfo<>(postList);
model.addAttribute("postList", postList);
model.addAttribute("pageInfo", pageInfo);
List<Category> categoryList = categoryService.list();
model.addAttribute("categoryList", categoryList);
return "adminSend";
} else {
attributes.addFlashAttribute("message", "权限不足,请先登录");
return "redirect:/toLogin";
}
}
@GetMapping("adminSendPost/{id}")
public String adminSendPost(@PathVariable Integer id) {
postService.updatePostStatusTo1(id, new Date()