基于javaweb的SSM快递取件管理系统(java+ssm+jsp+jquery+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

320023512402

330023512402

340023512402

350023512402

360023512402

370023512402

基于javaweb的SSM快递取件管理系统(java+ssm+jsp+jquery+mysql)

项目介绍

车险理赔管理系统源码,分为两个角色,一个管理员,一个普通用户 主要功能说明: 管理员角色包含以下功能:管理员登录,个人资料修改,用户管理,公告管理,快递状态管理,快递品牌管理,快递管理等功能。 用户角色包含以下功能: 用户注册后登录,个人资料管理,公告查看,查看本人的快递等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7等版本均可;

技术栈

  1. 后端:Spring springmvc mybatis 2. 前端:JSP+css+javascript+jQuery

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2.使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
}
package com.edu.controller;




/**
* email:dyb 1296@gmail.com
* function:MVC的C层,也就是控制层,这个Controller类可以实现对Pingpai这个类的控制,接收浏览器发送的请求并处理。Pingpai类的具体介绍,在com.edu.model.Pingpai类下,本处不在赘述
* 本文件和SSM结构的关系:SSM结构的架构就是JSP(浏览器)发送请求,然后请求到对应的Controller,然后Controller调用Service,Service调用Mapper,mapper调用数据库实现增删改查,最后由Controller返回到JSP完成全过程。
* 本文件对应Controller,负责表Pingpai
* 箭头结构:JSP->[Controller]->Service->Mapper->数据库-->JSP
* MVC层级划分:本文件在MVC模式中的C层,即控制层
*/
@Controller//说明这个文件是MVC三层架构的Controller,加了这个注解之后,spring可以自动扫描到这个类,可以自动对类进行配置,这里也体现使用了spring框架
@RequestMapping(value = "Pingpai")//定义请求的路径,路径为Pingpai,定义之后,浏览器获取数据就根据这个路径来进行访问,其他的同理,只要有@RequestMapping注解的都是这样
public class PingpaiController {//Controller包含在名字中是一种规范
@Autowired//自动注入,Spring的注解,这样的话,程序就可以自动把这个类扫进来,不需要手动创建对象
private PingpaiService pingpaiService;//调用数据库mapper,mybatis框架的内容,可以实现增删改查

@RequestMapping(value = "/initPage.do")//设置添加跳转的页面
public String initPage(HttpServletRequest request, Model model) {//在点击添加的时候加载一些预置代码
return "Pingpai/saveOrUpdate";//跳转到编辑页面
}

@RequestMapping(value = "/selectList.do")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29




public class BinaryUploader {

public static final State save(HttpServletRequest request,
Map<String, Object> conf) {
FileItemStream fileStream = null;
boolean isAjaxUpload = request.getHeader( "X_Requested_With" ) != null;

if (!ServletFileUpload.isMultipartContent(request)) {
return new BaseState(false, AppInfo.NOT_MULTIPART_CONTENT);
}

ServletFileUpload upload = new ServletFileUpload(
new DiskFileItemFactory());

if ( isAjaxUpload ) {
upload.setHeaderEncoding( "UTF-8" );
}

try {
FileItemIterator iterator = upload.getItemIterator(request);

while (iterator.hasNext()) {
fileStream = iterator.next();

if (!fileStream.isFormField())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31




public class BinaryUploader {

public static final State save(HttpServletRequest request,
Map<String, Object> conf) {
FileItemStream fileStream = null;
boolean isAjaxUpload = request.getHeader( "X_Requested_With" ) != null;

if (!ServletFileUpload.isMultipartContent(request)) {
return new BaseState(false, AppInfo.NOT_MULTIPART_CONTENT);
}

ServletFileUpload upload = new ServletFileUpload(
new DiskFileItemFactory());

if ( isAjaxUpload ) {
upload.setHeaderEncoding( "UTF-8" );
}

try {
FileItemIterator iterator = upload.getItemIterator(request);

while (iterator.hasNext()) {
fileStream = iterator.next();

if (!fileStream.isFormField())
break;
fileStream = null;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

public class ActionEnter {

private HttpServletRequest request = null;

private String rootPath = null;
private String contextPath = null;

private String actionType = null;

private ConfigManager configManager = null;

public ActionEnter ( HttpServletRequest request, String rootPath ) {

this.request = request;
this.rootPath = rootPath;
this.actionType = request.getParameter( "action" );
this.contextPath = request.getContextPath();
this.configManager = ConfigManager.getInstance( this.rootPath, this.contextPath, request.getRequestURI() );

}

public String exec () {

String callbackName = this.request.getParameter("callback");

if ( callbackName != null ) {

if ( !validCallbackName( callbackName ) ) {
return new BaseState( false, AppInfo.ILLEGAL ).toJSONString();
}

return callbackName+"("+this.invoke()+");";

} else {
return this.invoke();
}

}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	}

@RequestMapping(value = "/deleteManyDataByIds.do")//批量删除
public String deleteManyDataByIds(HttpServletRequest request, User user,Model model) {
String ids[] = request.getParameterValues("id"); //获取ID的列表
for (String id : ids) {//考虑可能传多个id
user = new User();
user.setId(Integer.parseInt(id));
try{
gongaoService.deleteById(user.getId());//删除的核心代码
}catch(Exception e){}
}
return this.getAllDataInPage(request, model);
}

@RequestMapping(value = "/saveOrupdate.do")//这里是编辑或者添加的具体代码
public String saveOrupdate(HttpServletRequest request, Gongao util, Model model) {
List<Gongao> list = gongaoService.getList("name", util.getName());
if (0 == util.getId()) {
if (list.size() > 0) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Gongao/saveOrUpdate";
}
gongaoService.insert(util);
} else {
if (list.size() > 1) {
model.addAttribute("util", util);
model.addAttribute("errMsg", "该信息已存在!");
return "Gongao/saveOrUpdate";
}
gongaoService.update(util);
}
return this.getAllDataInPage(request, model);
}

@RequestMapping(value = "/export.do")
public void export(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {//获取列表,最后跳转到列表查询页面,获取的是
Map<String, Object> row2 = new LinkedHashMap<String, Object>();
Map<String, Object> row = new LinkedHashMap<String, Object>();
String field = request.getParameter("field");
String fieldValue = request.getParameter("fieldValue");//当前端有查询的时候,这里的fieldValue就不是空,否则是空
try {
fieldValue = new String(fieldValue.getBytes("UTF-8"), "UTF-8");//防止乱码
} catch (Exception e) {}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

if (fileStream == null) {
return new BaseState(false, AppInfo.NOTFOUND_UPLOAD_DATA);
}

String savePath = (String) conf.get("savePath");
String originFileName = fileStream.getName();
String suffix = FileType.getSuffixByFilename(originFileName);

originFileName = originFileName.substring(0,
originFileName.length() - suffix.length());
savePath = savePath + suffix;

long maxSize = ((Long) conf.get("maxSize")).longValue();

if (!validType(suffix, (String[]) conf.get("allowFiles"))) {
return new BaseState(false, AppInfo.NOT_ALLOW_FILE_TYPE);
}

savePath = PathFormat.parse(savePath, originFileName);

String physicalPath = (String) conf.get("rootPath") + savePath;

InputStream is = fileStream.openStream();
State storageState = StorageManager.saveFileByInputStream(is,
physicalPath, maxSize);
is.close();

if (storageState.isSuccess()) {
storageState.putInfo("url", PathFormat.format(savePath));
storageState.putInfo("type", suffix);
storageState.putInfo("original", originFileName + suffix);
}

return storageState;
} catch (FileUploadException e) {
return new BaseState(false, AppInfo.PARSE_REQUEST_ERROR);
} catch (IOException e) {
}
return new BaseState(false, AppInfo.IO_ERROR);
}

private static boolean validType(String type, String[] allowTypes) {
List<String> list = Arrays.asList(allowTypes);

return list.contains(type);
}
}


项目链接:
https://javayms.github.io?id=511122522008200pi
https://javayms.pages.dev?id=511122522008200pi