基于javaweb的校园物流快递管理系统(java+jsp+springboot+layui+mysql)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+SpringBoot的校园物流快递管理系统(java+maven+JSP+SpringBoot+layui+mysql)
一、项目运行 环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
JSP +SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
客户管理控制层:
@Controller
@RequestMapping(“/customer”)
public class CustomerController {
@Autowired
private CustomerViewService customerViewService;
@Autowired
private CustomerService customerService;
@Autowired
private BasicDataService basicDataService;
@Autowired
private UserService userService;
@RequestMapping(“/list”)
@RequiresPermissions(“customer:list”)
public String list() {
return “customer/list”;
@ResponseBody
@RequestMapping(“/getCustomers”)
@RequiresPermissions(“customer:list”)
public PageInfo getCustomers(String keyWord,
@RequestParam(defaultValue = “1”) Integer pageNum,
@RequestParam(defaultValue = “10”) Integer pageSize) {
//开始分页,这里启动并设置页码,和每页结果数量后,后续结果会自动为分页后结果
PageHelper.startPage(pageNum, pageSize);
CustomerViewExample customerViewExample = new CustomerViewExample();
CustomerViewExample.Criteria criteria = customerViewExample.createCriteria();
/**
- StringUtils.isNotBlank 可以判断 “”/" "/null 为 false
*/
if (StringUtils.isNotBlank(keyWord)) {
//权限名条件
criteria.andCustomerNameLike(“%” + keyWord + “%”);
//判断当前登录用户是否为业务员,业务员只能查看自己的客户
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
if (user.getRoleId() == ConstantDataField.SALESMAN_ROLE_ID) {
//客户的业务员id等于登录用户的id
criteria.andUserIdEqualTo(user.getUserId());
List customers = customerViewService.selectByExample(customerViewExample);
//获得分页对象
PageInfo pageInfo = new PageInfo<>(customers);
return pageInfo;
@ResponseBody
@RequestMapping(“/delete”)
@RequiresPermissions(“customer:delete”)
public Map<String, String> delete(Long[] customerIds) {
HashMap<String, String> map = new HashMap<>();
if (customerIds.length == 1) {
int res = customerService.deleteByPrimaryKey(customerIds[0]);
if (res == 1) {
map.put(“status”, “true”);
map.put(“info”, “删除成功!”);
return map;
map.put(“status”, “false”);
map.put(“info”, “删除失败!客户已经不存在”);
return map;
//批量删除
int success = 0;
int total = customerIds.length;
for(Long customerId : customerIds) {
success += customerService.deleteByPrimaryKey(customerId);
map.put(“status”, “true”);
map.put(“info”, “成功删除选中 " + total + " 个客户中的 " + success + " 个客户”);
<