java项目-基于SSM实现物流信息管理系统

作者主页:编程指南针

作者简介:Java领域优质创作者、CSDN博客专家 、掘金特邀作者、多年架构师设计经验、腾讯课堂常驻讲师

主要内容:Java项目、毕业设计、简历模板、学习资料、面试题库、技术互助

文末获取源码 

一,项目简介

基于SSM框架的物流管理系统主要分为三种用户角色,分别是管理员、员工以及客户用户,其具体功能如下:

管理员:管理员登录后主要功能模块有个人信息,客户管理,反馈信息,基础信息,货物信息以及货物运输。

员工用户:员工用户登录后主要模块有个人信息,配送范围,货物信息,货物运输以及反馈信息。

客户用户:客户用户登录后主要模块有个人信息,配送范围,货物信息,货物运输以及反馈信息。

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

后台开发:SSM框架

前端开发:Bootstrap+Jquery+Echart

三,系统展示

展示一下部分系统的功能:

用户登陆

管理员主功能界面:

员工管理

客户管理

反馈信息

基础信息管理

货物信息审核

货物运输

客户角色的管理主界面

普通管理用户的管理主界面

四,核心代码展示


package com.action;

import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import com.model.*;
import com.service.*;
import com.util.*;

@Controller
public class GgtypeAction {
	@Autowired
	private GgtypeService ggtypeService;

	@RequestMapping("/getGgtypes")
	public void getGgtypes(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		String page = (String) request.getParameter("page");
		String rows = (String) request.getParameter("rows");
		String ggtypeName = (String) request.getParameter("ggtypeName");
		String ggtypeId = (String) request.getParameter("ggtypeId");
		PageBean pageBean = new PageBean(Integer.parseInt(page), Integer.parseInt(rows));
		Ggtype ggtype = new Ggtype();
		try {
			if (StringUtil.isNotEmpty(ggtypeName)) {
				ggtype.setGgtypeName(ggtypeName);
			}
			if (StringUtil.isNotEmpty(ggtypeId)) {
				ggtype.setGgtypeId(Integer.parseInt(ggtypeId));
			}
			JSONArray jsonArray = JSONArray.fromObject(ggtypeService.queryGgtypes(ggtype, pageBean.getStart(), pageBean.getRows()));
			JSONObject result = new JSONObject();
			int total = ggtypeService.queryGgtypes(ggtype, 0, 0).size();
			result.put("rows", jsonArray);
			result.put("total", total);
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/addGgtype")
	public void addGgtype(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		try {
			JSONObject result = new JSONObject();

			String ggtypeName = (String) request.getParameter("ggtypeName");
			String ggtypeMark = (String) request.getParameter("ggtypeMark");
			String ggtypeId = (String) request.getParameter("ggtypeId");
			Ggtype ggtype = new Ggtype();

			if (StringUtil.isNotEmpty(ggtypeId)) {
				ggtype = ggtypeService.getGgtype(Integer.parseInt(ggtypeId));
			}
			if (StringUtil.isNotEmpty(ggtypeName)) {
				ggtype.setGgtypeName(ggtypeName);
			}
			if (StringUtil.isNotEmpty(ggtypeMark)) {
				ggtype.setGgtypeMark(ggtypeMark);
			}

			if (StringUtil.isNotEmpty(ggtypeId)) {
				ggtypeService.modifyGgtype(ggtype);
			} else {
				ggtypeService.save(ggtype);
			}
			result.put("success", "true");

			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/deleteGgtype")
	public void deleteGgtype(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		try {
			String delIds = (String) request.getParameter("delIds");
			System.out.println("delIds = " + delIds);
			JSONObject result = new JSONObject();
			String str[] = delIds.split(",");
			for (int i = 0; i < str.length; i++) {
				ggtypeService.deleteGgtype(Integer.parseInt(str[i]));
			}
			result.put("success", "true");
			result.put("delNums", str.length);
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/ggtypeComboList")
	public void ggtypeComboList(HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		try {
			JSONArray jsonArray = new JSONArray();
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("id", "");
			jsonObject.put("ggtypeName", "请选择...");
			jsonArray.add(jsonObject);
			jsonArray.addAll(JSONArray.fromObject(ggtypeService.queryGgtypes(null, 0, 0)));
			ResponseUtil.write(response, jsonArray);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


package com.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.model.*;
import com.service.*;

@Controller
public class AdminAction {
	@Autowired
	private AdminService adminService;

	@RequestMapping("/mimaAdmin")
	public void mimaAdmin(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		try {
			JSONObject result = new JSONObject();

			String adminPassword = (String) request.getParameter("adminPassword");
			String adminPassword1 = (String) request.getParameter("adminPassword1");
			Admin admin = new Admin();
			admin.setAdminName("admin");
			admin.setAdminPassword(adminPassword);
			if (adminService.queryAdmins(admin, 0, 0).size()==1) {
				admin = (Admin)(adminService.queryAdmins(admin, 0, 0)).get(0);
				admin.setAdminPassword(adminPassword1);
				adminService.modifyAdmin(admin);
				request.setAttribute("error", "密码修改成功!");
				request.getRequestDispatcher("adminmima.jsp").forward(request,
						response);
			}else{
				result.put("success", "true");
				request.setAttribute("error", "原密码错误,请重新输入!");
				request.getRequestDispatcher("adminmima.jsp").forward(request,
						response);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


package com.action;

import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import com.model.*;
import com.service.*;
import com.util.*;

@Controller
public class RoleAction {
	@Autowired
	private RoleService roleService;

	@RequestMapping("/getRoles")
	public void getRoles(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		String page = (String) request.getParameter("page");
		String rows = (String) request.getParameter("rows");
		String roleName = (String) request.getParameter("roleName");
		String roleId = (String) request.getParameter("roleId");
		String roleMark2 = (String) request.getParameter("roleMark2");
		PageBean pageBean = new PageBean(Integer.parseInt(page), Integer.parseInt(rows));
		Role role = new Role();
		try {
			if (StringUtil.isNotEmpty(roleName)) {
				role.setRoleName(roleName);
			}
			if (StringUtil.isNotEmpty(roleId)) {
				role.setRoleId(Integer.parseInt(roleId));
			}
			if (StringUtil.isNotEmpty(roleMark2)) {
				role.setRoleMark2(Integer.parseInt(roleMark2));
			}
			JSONArray jsonArray = JSONArray.fromObject(roleService.queryRoles(role, pageBean.getStart(), pageBean.getRows()));
			JSONObject result = new JSONObject();
			int total = roleService.queryRoles(role, 0, 0).size();
			result.put("rows", jsonArray);
			result.put("total", total);
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/addRole")
	public void addRole(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		try {
			JSONObject result = new JSONObject();

			String roleName = (String) request.getParameter("roleName");
			String roleMark = (String) request.getParameter("roleMark");
			String roleMark1 = (String) request.getParameter("roleMark1");
			String roleMark2 = (String) request.getParameter("roleMark2");
			String roleId = (String) request.getParameter("roleId");
			Role role = new Role();

			if (StringUtil.isNotEmpty(roleId)) {
				role = roleService.getRole(Integer.parseInt(roleId));
			}
			if (StringUtil.isNotEmpty(roleName)) {
				role.setRoleName(roleName);
			}
			if (StringUtil.isNotEmpty(roleMark)) {
				role.setRoleMark(roleMark);
			}
			if (StringUtil.isNotEmpty(roleMark1)) {
				role.setRoleMark1(roleMark1);
			}
			if (StringUtil.isNotEmpty(roleMark2)) {
				role.setRoleMark2(Integer.parseInt(roleMark2));
			}

			if (StringUtil.isNotEmpty(roleId)) {
				roleService.modifyRole(role);
			} else {
				roleService.save(role);
			}
			result.put("success", "true");

			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/deleteRole")
	public void deleteRole(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		try {
			String delIds = (String) request.getParameter("delIds");
			System.out.println("delIds = " + delIds);
			JSONObject result = new JSONObject();
			String str[] = delIds.split(",");
			for (int i = 0; i < str.length; i++) {
				roleService.deleteRole(Integer.parseInt(str[i]));
			}
			result.put("success", "true");
			result.put("delNums", str.length);
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/roleComboList")
	public void roleComboList(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		String roleMark2 = (String) request.getParameter("roleMark2");
		Role role = new Role();

		if (StringUtil.isNotEmpty(roleMark2)) {
			role.setRoleMark2(Integer.parseInt(roleMark2));
		}
		try {
			JSONArray jsonArray = new JSONArray();
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("id", "");
			jsonObject.put("roleName", "请选择...");
			jsonArray.add(jsonObject);
			//jsonArray.addAll(JSONArray.fromObject(roleService.queryRoles(role, 0, 0)));
			ResponseUtil.write(response, jsonArray);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


package com.action;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import com.model.*;
import com.service.*;
import com.util.*;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
//导入导出

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

@Controller
public class GonggaoAction {
	@Autowired
	private GonggaoService gonggaoService;
	@Autowired
	private GgtypeService ggtypeService;

	/***上传导入开始***/
	private InputStream excelFile;

	public InputStream getExcelFile() {
		return excelFile;
	}
	/***上传导入结束***/

	@RequestMapping("/getGonggaos")
	public void getGonggaos(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		String page = (String) request.getParameter("page");
		String rows = (String) request.getParameter("rows");
		String gonggaoName = (String) request.getParameter("gonggaoName");
		String gonggaoId = (String) request.getParameter("gonggaoId");
		String ggtypeId = (String) request.getParameter("ggtypeId");
		String sdate = (String) request.getParameter("sdate");
		String edate = (String) request.getParameter("edate");
		PageBean pageBean = new PageBean(Integer.parseInt(page), Integer.parseInt(rows));
		Gonggao gonggao = new Gonggao();
		try {
			if (StringUtil.isNotEmpty(gonggaoName)) {
				gonggao.setGonggaoName(gonggaoName);
			}
			if (StringUtil.isNotEmpty(gonggaoId)) {
				gonggao.setGonggaoId(Integer.parseInt(gonggaoId));
			}
			if (StringUtil.isNotEmpty(ggtypeId)) {
				gonggao.setGgtypeId(Integer.parseInt(ggtypeId));
			}
			JSONArray jsonArray = JSONArray.fromObject(gonggaoService.queryGonggaos(
					gonggao, pageBean.getStart(), pageBean.getRows(), sdate, edate));
			JSONObject result = new JSONObject();
			int total = gonggaoService.queryGonggaos(gonggao, 0, 0, sdate, edate).size();
			result.put("rows", jsonArray);
			result.put("total", total);
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/addGonggao")
	public void addGonggao(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		JSONObject result = new JSONObject();
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		String gonggaoName = (String) request.getParameter("gonggaoName");
		String gonggaoMark = (String) request.getParameter("gonggaoMark");
		String gonggaoDate = (String) request.getParameter("gonggaoDate");
		String ggtypeId = (String) request.getParameter("ggtypeId");
		String gonggaoId = (String) request.getParameter("gonggaoId");
		Gonggao gonggao = new Gonggao();

		if (StringUtil.isNotEmpty(gonggaoId)) {
			gonggao = gonggaoService.getGonggao(Integer.parseInt(gonggaoId));
		}
		if (StringUtil.isNotEmpty(gonggaoName)) {
			gonggao.setGonggaoName(gonggaoName);
		}
		if (StringUtil.isNotEmpty(gonggaoMark)) {
			gonggao.setGonggaoMark(gonggaoMark);
		}
		if (StringUtil.isNotEmpty(gonggaoDate)) {
			gonggao.setGonggaoDate(DateUtil.formatString(gonggaoDate,
					"yyyy-MM-dd hh:mm:ss"));
		}
		if (StringUtil.isNotEmpty(ggtypeId)) {
			gonggao.setGgtypeId(Integer.parseInt(ggtypeId));
			Ggtype ggtype = new Ggtype();
			ggtype = ggtypeService.getGgtype(Integer.parseInt(ggtypeId));
			gonggao.setGgtypeName(ggtype.getGgtypeName());
		}
		try {
			if (StringUtil.isNotEmpty(gonggaoId)) {
				gonggaoService.modifyGonggao(gonggao);
				result.put("success", "true");
				ResponseUtil.write(response, result);
			} else {
				Date date = new Date();
				gonggao.setGonggaoDate(date);
				gonggaoService.save(gonggao);
				result.put("success", "true");
				ResponseUtil.write(response, result);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/deleteGonggao")
	public void deleteGonggao(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		JSONObject result = new JSONObject();
		String delIds = (String) request.getParameter("delIds");
		try {
			String str[] = delIds.split(",");
			for (int i = 0; i < str.length; i++) {
				gonggaoService.deleteGonggao(Integer.parseInt(str[i]));
			}
			result.put("success", "true");
			result.put("delNums", str.length);
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/gonggaoComboList")
	public void gonggaoComboList(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		String ggtypeId = (String) request.getParameter("ggtypeId");
		Gonggao gonggao = new Gonggao();
		if (StringUtil.isNotEmpty(ggtypeId)) {
			gonggao.setGgtypeId(Integer.parseInt(ggtypeId));
		}
		try {
			JSONArray jsonArray = new JSONArray();
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("id", "");
			jsonObject.put("gonggaoName", "请选择...");
			jsonArray.add(jsonObject);
			jsonArray.addAll(JSONArray.fromObject(gonggaoService.queryGonggaos(gonggao, 0, 0, null, null)));
			ResponseUtil.write(response, jsonArray);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/gonggaoTongji")
	public void gonggaoTongji(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		String sdate=request.getParameter("sdate");
		String edate=request.getParameter("edate");
		List<Integer> ggtypeIds = new ArrayList<Integer>();
		List<String> ggtypeNames = new ArrayList<String>();
		List<Integer> gonggaoZongshus = new ArrayList<Integer>();
		List<Ggtype> ggtypes = new ArrayList<Ggtype>();
		List<Gonggao> gonggaos = new ArrayList<Gonggao>();
		Gonggao gonggao = new Gonggao();
		Integer zongshu = 0;
		try {
			ggtypes = ggtypeService.queryGgtypes(null, 0,0);
			for(int i=0;i<ggtypes.size();i++){
				ggtypeIds.add(ggtypes.get(i).getGgtypeId());
				ggtypeNames.add(ggtypes.get(i).getGgtypeName());
			}
			for(int i=0;i<ggtypeIds.size();i++){
				Integer gonggaoZongshu = 0;
				gonggao.setGgtypeId(ggtypeIds.get(i));
				gonggaos = gonggaoService.queryGonggaos(gonggao, 0, 0, sdate, edate);
				for(int j=0;j<gonggaos.size();j++){
					gonggaoZongshu = gonggaoZongshu + gonggaos.size();
				}
				zongshu = zongshu + gonggaoZongshu;
				gonggaoZongshus.add(gonggaoZongshu);
			}

			HttpSession session = request.getSession();
			session.setAttribute("ggtypeNames", ggtypeNames);
			session.setAttribute("gonggaoZongshus", gonggaoZongshus);
			session.setAttribute("zongshu", zongshu);
			response.sendRedirect("admin/gonggaotongji.jsp");

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/shangchuanGonggao")
	public void shangchuanGonggao(HttpServletRequest request, HttpServletResponse response,MultipartFile uploadFile)
			throws Exception {
		try {
			String gonggaoId = (String) request.getParameter("gonggaoId");
			String directory = "/file";
			String targetDirectory = request.getSession().getServletContext().getRealPath(directory);
	        String fileName = uploadFile.getOriginalFilename();
			File dir = new File(targetDirectory,fileName);
	        if(!dir.exists()){
	            dir.mkdirs();
	        }
	        //MultipartFile自带的解析方法
	        uploadFile.transferTo(dir);

			String shangchuandizhi = "/file" + "/" + fileName;
			String shangchuanname = fileName;
			Gonggao gonggao = gonggaoService.getGonggao(Integer.parseInt(gonggaoId));
			gonggao.setGonggaoImg(shangchuandizhi);
			gonggao.setGonggaoImgName(shangchuanname);
			gonggaoService.modifyGonggao(gonggao);
			JSONObject result = new JSONObject();
			result.put("success", "true");
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/xiazaiGonggao")
	public void xiazaiGonggao(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String filename = (String) request.getParameter("filename");
        //模拟文件,myfile.txt为需要下载的文件
        String path = request.getSession().getServletContext().getRealPath("file")+"\\"+filename;
        //获取输入流
        InputStream bis = new BufferedInputStream(new FileInputStream(new File(path)));
        //转码,免得文件名中文乱码
        filename = URLEncoder.encode(filename,"UTF-8");
        //设置文件下载头
        response.addHeader("Content-Disposition", "attachment;filename=" + filename);
        //1.设置文件ContentType类型,这样设置,会自动判断下载文件类型
        response.setContentType("multipart/form-data");
        BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
        int len = 0;
        while((len = bis.read()) != -1){
            out.write(len);
            out.flush();
        }
        out.close();
	}

	@RequestMapping("/daoruGonggao")
	public void daoruGonggao(HttpServletRequest request, HttpServletResponse response,MultipartFile uploadFile)
			throws Exception {
		try {
			String directory = "/file";
			String targetDirectory = request.getSession().getServletContext().getRealPath(directory);
	        String fileName = uploadFile.getOriginalFilename();
			File dir = new File(targetDirectory,fileName);
	        if(!dir.exists()){
	            dir.mkdirs();
	        }
	        //MultipartFile自带的解析方法
	        uploadFile.transferTo(dir);
			excelFile = new FileInputStream(dir);
			Workbook wb = new HSSFWorkbook(excelFile);
			Sheet sheet = wb.getSheetAt(0);
			int rowNum = sheet.getLastRowNum() + 1;
			for (int i = 1; i < rowNum; i++) {
				Gonggao gonggao = new Gonggao();
				Row row = sheet.getRow(i);
				int cellNum = row.getLastCellNum();
				for (int j = 0; j < cellNum; j++) {
					Cell cell = row.getCell(j);
					String cellValue = null;
					switch (cell.getCellType()) { // 判断excel单元格内容的格式,并对其进行转换,以便插入数据库
					case 0:
						cellValue = String.valueOf((int) cell
								.getNumericCellValue());
						break;
					case 1:
						cellValue = cell.getStringCellValue();
						break;
					case 2:
						cellValue = cell.getStringCellValue();
						break;
					}

					switch (j) {// 通过列数来判断对应插如的字段
					case 1:
						gonggao.setGonggaoName(cellValue);
						break;
					case 2:
						gonggao.setGonggaoMark(cellValue);
						break;
					}
				}
				gonggaoService.save(gonggao);
			}
			JSONObject result = new JSONObject();
			result.put("success", "true");
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/daochuGonggao")
	public void daochuGonggao(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String delIds = (String) request.getParameter("delIds");
		JSONObject result = new JSONObject();
		String str[] = delIds.split(",");

		// 创建一个Excel文件
		HSSFWorkbook workbook = new HSSFWorkbook();
		// 创建一个工作表
		HSSFSheet sheet = workbook.createSheet("gonggaos记录");
		// 添加表头行
		HSSFRow hssfRow = sheet.createRow(0);
		// 设置单元格格式居中
		HSSFCellStyle cellStyle = workbook.createCellStyle();
		cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);

		// 添加表头内容
		HSSFCell headCell = hssfRow.createCell(0);
		headCell.setCellValue("编号");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(1);
		headCell.setCellValue("用户名");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(2);
		headCell.setCellValue("密码");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(3);
		headCell.setCellValue("姓名");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(4);
		headCell.setCellValue("性别");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(5);
		headCell.setCellValue("年龄");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(6);
		headCell.setCellValue("电话");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(7);
		headCell.setCellValue("备注1");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(8);
		headCell.setCellValue("备注2");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(9);
		headCell.setCellValue("备注3");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(10);
		headCell.setCellValue("备注4");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(13);
		headCell.setCellValue("标志1");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(14);
		headCell.setCellValue("备注2");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(15);
		headCell.setCellValue("权限");
		headCell.setCellStyle(cellStyle);

		headCell = hssfRow.createCell(16);
		headCell.setCellValue("部门");
		headCell.setCellStyle(cellStyle);

		// 添加数据内容
		for (int i = 0; i < str.length; i++) {
			hssfRow = sheet.createRow((int) i + 1);
			Gonggao gonggao = gonggaoService.getGonggao(Integer.parseInt(str[i]));

			// 创建单元格,并设置值
			HSSFCell cell = hssfRow.createCell(0);
			cell.setCellValue(gonggao.getGonggaoId());
			cell.setCellStyle(cellStyle);

			cell = hssfRow.createCell(1);
			cell.setCellValue(gonggao.getGonggaoName());
			cell.setCellStyle(cellStyle);

			cell = hssfRow.createCell(7);
			cell.setCellValue(gonggao.getGonggaoMark());
			cell.setCellStyle(cellStyle);

			cell = hssfRow.createCell(16);
			cell.setCellValue(gonggao.getGgtypeName());
			cell.setCellStyle(cellStyle);
		}

		// 保存Excel文件
		try {
			Date date = new Date();
			String strdate = DateUtil.formatDate(date, "yyyyMMddhhmmss");
			OutputStream outputStream = new FileOutputStream("D:/gonggao"
					+ strdate + ".xls");
			workbook.write(outputStream);
			outputStream.close();
			result.put("success", "true");
			ResponseUtil.write(response, result);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

五,项目总结

   本项目主要基于物流信息的基本管理功能实现的一个信息化管理系统,客户登陆系统后可以添加货物并进行运输信息的选择和添加,普通用户进入系统可以对用户的发货信息进行审核,并根据运输情况改变运输状态,客户在货物运达后可以进行验收操作。整个业务流程十分完整。管理员主要进行基础信息的基本管理,也可以进行相关的业务操作。

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
基于Java物流管理系统设计与实现 摘 要:随着世界经济的飞速发展,电商行业的成熟,使得物流行业逐渐变成人们关注的经 济热点。中国与物流相关的年总支出有139000亿元,物流成本占总GDP的20%- 25%,不可否认物流行业的发展潜力一步步的展现了出来。此次的物流公司订单管理系统 是应用于现代物流公司业务设计的,用于提高公司工作效率,主要包括:客户信息管理物流信息管理、客户订单管理与货物配送管理。相比传统的物流管理方式如手工录入 ,核查物流信息的方式,本系统节省了人力物力的提高了物流运输的效率,实现物流 配送的流程智能化,简单化。不仅为物流公司的客户带来便利,企业的效率得到提升。 关键词:物流管理管理系统、JSP、B/S结构。 Abstract: As the rapid development of the world economy and the maturity of the e-commerce industry, The logistics industry has gradually become an economic hot spot. China's total annual expenditure related to logistics is 139 billion yuan and the cost of logistics accounts for 20 % - 25 % of the total GDP. There is no denying that the development potential of the logistics industry is showing step by step. This order management system of logistics company is applied to the business design of modern logistics company to improve the work efficiency of the company, mainly including customer information management, logistics information management, customer order management and goods distribution management. Compared with traditional logistics management methods such as manual entry and checking of logistics information, this system saves manpower and material resources, improves the efficiency of logistics transportation and realizes the intellectualization and simplification of logistics distribution process. It not only brings convenience to the customers of the logistics company, but also improves the efficiency of the enterprise. Key words: Logistics ,Management systems, JSP, B / S structure. 目 录 摘 要 I Abstract I 目 录 II 1 绪论 1 1.1 研究背景 1 1.2 研究目的与意义 1 1.3 开发工具介绍 2 2 需求分析 4 2.1 需求考察 4 2.2 可行性分析 4 2.2.1 技术的可行性 4 2.2.2 经济的可行性 5 2.2.3 操作可行性 5 2.2.4 法律的可行性 5 2.3 系统用户用例图 5 2.4 功能模块需求分析 7 2.4.1 实现功能 7 2.4.2 功能详解 8 2.5 性能需求 9 2.5.1 系统的安全性 9 2.5.2 数据的完整性 9 2.6 界面需求 9 3 系统分析与设计 10 3.1 数据库的分析与设计 10 3.1.2 数据库的逻辑结构设计 10 3.2 数据分析 10 3.3.1 数据库的E-R图设计 11 3.3.2 数据表的设计 12 3.4 数据库的连接 13 3.5 处理乱码问题 14 4 系统功能实现 16 4.1 系统的主界面设计 16 4.2 管理员功能模块的设计与实现 17 4.3 系统管理的设计与实现 1
基于SSM(Spring+SpringMVC+MyBatis)实现物流管理系统是一种常用的架构方案。物流管理系统主要通过集成各个环节的信息流和物流实现货物的准确追踪和快速配送。以下是300字的具体回答: 物流管理系统的架构主要分为前端展示、后端服务以及数据库三层结构。 前端展示层可以使用HTML、CSS和JavaScript等技术,结合Bootstrap等框架来实现用户界面的设计和交互。通过页面展示,用户能够方便地浏览物流信息、下单、查询等。 后端服务层使用Spring框架来实现业务逻辑的处理。该层主要负责用户的请求接收和处理,以及与数据库的交互。通过Spring的IoC和AOP特性,可以实现各个模块之间的松耦合和切面编程。SpringMVC作为框架中的MVC层,可以方便地处理请求的分发和响应。 数据库层使用MyBatis框架来操作数据。MyBatis是一种简单、易用且灵活的持久化框架,通过XML配置和SQL映射,可以实现数据库的增删改查操作。通过MyBatis的缓存机制,可以提高系统的性能。 在物流管理系统中,可以使用SSM实现用户管理、订单管理、仓库管理、配送管理等功能模块。例如,用户管理模块可以实现用户的注册、登录、个人信息管理等;订单管理模块可以实现订单的生成、查询、修改等;仓库管理模块可以实现仓库的添加、删除、修改等;配送管理模块可以实现货物的调度、运输轨迹的记录等。 通过SSM的整合,可以实现各个模块之间的数据交互,提高系统的稳定性和扩展性。同时,SSM的分层结构也方便团队协作开发,各个模块之间的职责清晰,易于维护和扩展。 综上所述,基于SSM实现物流管理系统具有较好的开发效率和系统性能,能够满足物流行业对于追踪和配送效率的需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程千纸鹤

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值