项目技术:
使用 spring boot,基于 ssm 框架和 shiro 安全框架,开发的一个物流管理系统。前端使用的是 H-ui 开源框架,运用了 Bootstrap table、zTree、PageHelper、jQuery validate 等插件。
特点
- 基于 spring boot、maven 构建;
- 运用了 spring、spring mvc、mybatis 和 shiro 框架;
- 采用了 RBAC 的思路设计系统,采用了 Mysql 作为数据库支持;
- 不同的角色登录系统会有不同的菜单列表,且会根据角色返回特定的数据;
- 拥有基础数据管理模块,管理员管理模块,角色管理模块,权限管理模块,客户管理模块,订单管理模块和业务处理模块;
- 能够实现完整的业务流程:添加客户、添加订单、订单处理、财务报表。
细节介绍
- 业务员访问时,只能访问客户管理、订单管理、业务处理菜单,且只有添加的权力,没有修改和删除的权力;
- 业务员添加订单时,只能基于自己拥有的客户添加;
- 业务经理拥有客户管理、订单管理、业务处理的所有功能,可以查看所有业务员的客户和订单;
- 总经理角色可以查看所有数据,但是没有修改的权力;
- 仓管员只有业务处理中,测量物品信息和入库的功能,其他数据不可修改;
- 财务可以查看审核订单价格详情并导出为 excel 表格。
运行环境:
- JDK 1.8;
- Maven;
- Tomcat 8;
- Mysql 8.0/Mysql 5.7均可。
使用前修改 application.properties 里的数据库的连接信息即可。可以通过 dataBase 目录下的 sql 文件创建所需要的表,数据库名字为 logistic_system。
测试账号
username:admin
password:123456
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
* 删除角色
* @param request
* @param id
* @return
*/
@RequestMapping(value="delete",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
try {
roleService.delete(id);
} catch (Exception e) {
// TODO: handle exception
return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);
}
log.info("编辑角色ID【"+id+"】");
operaterLogService.add("删除角色ID【"+id+"】");
return Result.success(true);
}
}
记录控制层:
@Controller
@RequestMapping("/admin/processRecords")
public class ProcessRecordsController {
@Autowired
private ProcessRecordsService processRecordsService;
@Autowired
* 进入执行运输列表根据订单编号查询
* @param pageBean
* @param waybillNumber
* @param model
* @return
*/
@RequestMapping("/receiveList")
public String receiveList(PageBean<ProcessRecords> pageBean, String waybillNumber, Model model) {
model.addAttribute("title", "运输列表");
model.addAttribute("waybillNumber", waybillNumber);
model.addAttribute("users",userService.findByUserTypeNot());
model.addAttribute("pageBean", processRecordsService.findListByWaybillNumber(pageBean, waybillNumber));
return "admin/process_records/receive_list";
}
/**
* 网点拾取快递并添加流程记录
* @param id
* @return
*/
@RequestMapping("/takeDeliveryOfGoods")
@ResponseBody
public Result<Boolean> takeDeliveryOfGoods(@RequestParam(name="id",required=true)Long id){
operaterLogService.add("删除角色ID【"+id+"】");
return Result.success(true);
}
}
记录控制层:
@Controller
@RequestMapping("/admin/processRecords")
public class ProcessRecordsController {
@Autowired
private ProcessRecordsService processRecordsService;
@Autowired
private UserService userService;
/**
* 进入运输收货列表根据订单编号查询
* @param pageBean
* @param waybillNumber
* @param model
* @return
*/
@RequestMapping("/list")
public String list(PageBean<ProcessRecords> pageBean, String waybillNumber, Model model) {
User loginedUser = SessionUtil.getLoginedUser();
model.addAttribute("title", "运输收货列表");
model.addAttribute("waybillNumber", waybillNumber);
model.addAttribute("UserRoleTypeEnum",loginedUser.getUserType().getCode());
@ResponseBody
public Result<Boolean> transportation(@RequestParam(name="id",required=true)Long id,
@RequestParam(name="userId",required=true)Long userId){
if (null == id){
return Result.error(CodeMsg.ADMIN_EXPRESSMAILORDER_SENDTHECARGO_ADD_EDIT_ERROR);
}
if (null == userId){
return Result.error(CodeMsg.ADMIN_EXPRESSMAILORDER_USER_NULL);
}
Integer integer = processRecordsService.transportation(id,userId);
if(integer == 1){
return Result.error(CodeMsg.ADMIN_EXPRESSMAILORDER_SENDTHECARGO_ADD_EDIT_ERROR);
}
return Result.success(true);
}
/**
* 指定快递员
* @param id
model.addAttribute("UserRoleTypeEnum",loginedUser.getUserType().getCode());
model.addAttribute("pageBean", processRecordsService.findList(pageBean, waybillNumber));
return "admin/process_records/list";
}
/**
* 进入执行运输列表根据订单编号查询
* @param pageBean
* @param waybillNumber
* @param model
* @return
*/
@RequestMapping("/receiveList")
public String receiveList(PageBean<ProcessRecords> pageBean, String waybillNumber, Model model) {
model.addAttribute("title", "运输列表");
model.addAttribute("waybillNumber", waybillNumber);
model.addAttribute("users",userService.findByUserTypeNot());
/**
* 删除角色
* @param request
* @param id
* @return
*/
@RequestMapping(value="delete",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
try {
roleService.delete(id);
} catch (Exception e) {
// TODO: handle exception
return Result.error(CodeMsg.ADMIN_ROLE_DELETE_ERROR);
}
* 编辑管理员信息表单提交处理
* @param user
* @return
*/
@RequestMapping(value="/edit",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> edit(User user){
//用统一验证实体方法验证是否合法
CodeMsg validate = ValidateEntityUtil.validate(user);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}
if(user.getRole() == null || user.getRole().getId() == null){
return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);
}
if(user.getId() == null || user.getId().longValue() <= 0){
return Result.error(CodeMsg.ADMIN_USE_NO_EXIST);
BeanUtils.copyProperties(processRecords, newProcessRecords,"id","createTime","updateTime");
newProcessRecords.setTravelPosition(ExpressMailOrderStatus.INTRANSIT);
newProcessRecords.setId(null);
newProcessRecords.setOperation(ProcessRecords.NO_OPERATIONS);
ProcessRecords saveNew = processRecordsService.save(newProcessRecords);
if (null == saveNew){
return Result.error(CodeMsg.ADMIN_EXPRESSMAILORDER1_RECEIVING_EDIT_ERROR);
}
ProcessRecords save = processRecordsService.save(processRecords);
if (null == save){
return Result.error(CodeMsg.ADMIN_EXPRESSMAILORDER1_RECEIVING_EDIT_ERROR);
}
return Result.success(true);
}
/**
private ProcessRecordsService processRecordsService;
@Autowired
private UserService userService;
/**
* 进入运输收货列表根据订单编号查询
* @param pageBean
* @param waybillNumber
* @param model
* @return
*/
@RequestMapping("/list")
public String list(PageBean<ProcessRecords> pageBean, String waybillNumber, Model model) {
User loginedUser = SessionUtil.getLoginedUser();
model.addAttribute("title", "运输收货列表");
model.addAttribute("waybillNumber", waybillNumber);
model.addAttribute("UserRoleTypeEnum",loginedUser.getUserType().getCode());
model.addAttribute("pageBean", processRecordsService.findList(pageBean, waybillNumber));
* @return
*/
@RequestMapping(value="/edit",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> edit(User user){
//用统一验证实体方法验证是否合法
CodeMsg validate = ValidateEntityUtil.validate(user);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}
if(user.getRole() == null || user.getRole().getId() == null){
return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY);
}
if(user.getId() == null || user.getId().longValue() <= 0){
return Result.error(CodeMsg.ADMIN_USE_NO_EXIST);
}
if(userService.isExistUsername(user.getUsername(), user.getId())){
return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
if(integer == 1){
return Result.error(CodeMsg.ADMIN_EXPRESSMAILORDER_SENDTHECARGO_ADD_EDIT_ERROR);
}
return Result.success(true);
}
}
后台管理员管理控制器:
/**
* 后台管理员管理控制器
* @author yy
*
*/
@RequestMapping("/admin/user")
@Controller
public class UserController {
@Autowired
private UserService userService;
@Autowired
private RoleService roleService;
@Autowired
private OperaterLogService operaterLogService;