基于javaweb的SSM+Maven车险理赔管理系统(java+ssm+jsp+echarts+jquery+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

180023512402

200023512402

210023512402

220023512402

230023512402

240023512402

基于javaweb的SSM+Maven车险理赔管理系统(java+ssm+jsp+echarts+jquery+mysql)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

流程:
user1登录
---添加保险
---申请理赔
admin登录
---[申请理赔列表]下审批
kanchayuan1登录
---[待调查事故保单]下确认调查记录([调查-记录]按钮)
---[现场勘察]下确认勘察记录([勘察-记录]按钮),注意:情况属实栏填数字1或0
admin登录
---[赔偿金发放列表]下[通过]审批
user1登录
---[我的理赔]下查看到赔偿已发放

项目介绍

车险理赔管理系统源码,分为三个用户,一个管理员,一个工作人员,一个普通人员 管理员功能:登录、发放赔偿金、赔偿金发放列表、申请理赔列表、申请理赔通过、我的资料、用户列表 工作人员功能:勘察员-待调查事故保单、勘察员-调查事故提交结果、勘察员-现场勘查记录、勘察员-现场勘查记录列表、勘察员-已调查记录 普通人员功能:用户-申请理赔、用户-添加保险、用户-我的保险、用户-我的理赔、用户-我的账户

环境需要

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/8.0等版本均可;

技术栈

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

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat, 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置,然后运行; 4. 运行成功后,在浏览器中输入:http://localhost:8081/ 账号 管理员 admin/admin 勘探员 kanchayuan2/123455 普通用户 1/1

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
49
          return "/admin/responsibility-view";
}
return "/admin/responsibility-add";
}

@RequestMapping("save")
@ResponseBody
public Result save(HttpServletRequest request,Responsibility model){
User user = (User) request.getSession().getAttribute("user");
int i = 0;
if (StringUtils.isBlank(model.getId())) {
model.preInsert();
model.setCreateDate(new Date());
i = responsibilityService.insertModel(model);
//更新保单状态
Orders orders = ordersService.getModel(model.getOrdersId());
orders.setState(3);
ordersService.updateModel(orders);
} else {
i = responsibilityService.updateModel(model);
}
if (i == 0) {
return ResultUtil.error("失败");
} else {
return ResultUtil.success(null);
}


}


//删除批量删除
@RequestMapping("delete")
@ResponseBody
public Result delete(HttpServletRequest request,String id){

if (StringUtils.isNotBlank(id)){
String[] split = id.split(",");
for (int i = 0; i < split.length; i++) {
responsibilityService.deleteModel(split[i]);
}
return ResultUtil.success();
}else {
return ResultUtil.error("未选中删除项!");
}

}


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
/**
* 图片查看大图
*
* @param id 附件id
*/
@RequestMapping(value = "image/{id}")
public void imageView(@PathVariable String id, HttpServletRequest request, HttpServletResponse response) throws Exception {
if (StringUtils.isBlank(id)){
return;
}
Attachment attachment = attachmentService.getModel(id);
String path = attachment.getPath();
// 后缀名
String suffix = attachment.getSuffix();
String realPath = rootpath + path;
try {
long downloadedLength = 0L;
//打开本地文件流
InputStream inputStream;

if (StringUtils.isNotBlank(suffix) && "pdf".equals(suffix.toLowerCase())){
ClassPathResource classPathResource = new ClassPathResource("static/img/pdf.png");
inputStream = classPathResource.getInputStream();
} else {
inputStream = new FileInputStream(realPath);
}

//激活下载操作
OutputStream os = response.getOutputStream();

//循环写入输出流
byte[] b = new byte[2048];
int length;
while ((length = inputStream.read(b)) > 0) {
os.write(b, 0, length);
downloadedLength += b.length;
}
// 这里主要关闭。
os.close();
inputStream.close();
} catch (Exception e) {
throw 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
    request.setAttribute("insurance",insurance);
Investigation investigation = investigationService.selectOneModel(MapUtil.buildMap("orderId", model.getId()));
if (investigation != null){
request.setAttribute("investigation",investigation);
return "/admin/investigation-view";
}
return "/admin/investigation-add";
}


@RequestMapping("edit")
public String edit(HttpServletRequest request,String id){
Investigation model = investigationService.getModel(id);
request.setAttribute("model",model);
return "/admin/investigation-add";
}

@RequestMapping("save")
@ResponseBody
public Result save(HttpServletRequest request,Investigation model){
User user = (User) request.getSession().getAttribute("user");
int i = 0;
if (StringUtils.isBlank(model.getId())) {
model.preInsert();
model.setCreateDate(new Date());
i = investigationService.insertModel(model);
//更新保单状态
Orders orders = ordersService.getModel(model.getOrderId());
orders.setState(2);
ordersService.updateModel(orders);
} else {
i = investigationService.updateModel(model);
}
if (i == 0) {
return ResultUtil.error("失败");
} else {
return ResultUtil.success(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
41
42
43
44
45
46
47


}
package com.filter;



public class LoginFilter implements Filter {

public void init(FilterConfig filterConfig) throws ServletException {

}

public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
// TODO Auto-generated method stub
HttpServletRequest req = (HttpServletRequest)servletRequest;
HttpServletResponse resp =(HttpServletResponse) servletResponse;
HttpSession session = req.getSession();
// 获得用户请求的URI
String attachmentId = req.getRequestURI();
// 从session取得已经登录验证的凭证 我这里的demo用的是password来作为登录凭证
User user = (User) session.getAttribute("user");
// login.jsp页面无需过滤
String[] urls = {"/login","/json",".js",".css",".ico",".jpg",".png","toreg","reg","/admin/login","/admin/attachment","/files/upload"};
boolean flag = true;
for (String str : urls) {
if (attachmentId.indexOf(str) != -1) {
flag =false;
break;
}
}

if (flag){
if(attachmentId.indexOf("login") > -1 || attachmentId.indexOf("app") > -1 ) {//注意:登录页面千万不能过滤 不然过滤器就。。。。。自行调试不要偷懒!这样记忆深刻
filterChain.doFilter(req, resp);
return;
} else {//如果不是login.jsp进行过滤
if (user == null ) {
// 跳转到登陆页面
resp.sendRedirect("/admin/login");
} else {
// 已经登陆,继续此次请求
filterChain.doFilter(req, resp);
}
}
}else {
filterChain.doFilter(req, resp);
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
    }

@RequestMapping("logout")
public String loout(HttpServletRequest request) {
request.getSession().invalidate();
return "/admin/login";
}

@RequestMapping("register")
public String regUser() {
return "/admin/register";
}




@RequestMapping("reg")
@ResponseBody
public Result reguser(HttpServletRequest request, User user, Integer type) {
String username = user.getUsername();
User oneModel = userService.selectOneModel(MapUtil.buildMap("username", username));
if(oneModel != null){
return ResultUtil.error("用户已被占用!");
}
user.preInsert();
int i = userService.insertModel(user);
if (i == 0) {
return ResultUtil.error("失败");
} else {
return ResultUtil.success(null);
}
}

public static void main(String[] args) {

}
}
package com.controller;

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
49
/**
* 附件下载
*
* @param id 附件id
*/
@RequestMapping(value = "file/{id}")
public void download(@PathVariable String id, HttpServletRequest request, HttpServletResponse response) throws Exception {
Attachment attachment = attachmentService.getModel(id);
String path = attachment.getPath();
// 后缀名
String suffixName = path.substring(path.lastIndexOf("."));
// 设置强制下载不打开
response.setContentType("application/force-download;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(attachment.getName(), "UTF-8"));

String realPath = rootpath + path;
try {
long downloadedLength = 0L;
//打开本地文件流
InputStream inputStream = new FileInputStream(realPath);
//激活下载操作
OutputStream os = response.getOutputStream();

//循环写入输出流
byte[] b = new byte[2048];
int length;
while ((length = inputStream.read(b)) > 0) {
os.write(b, 0, length);
downloadedLength += b.length;
}
// 这里主要关闭。
os.close();
inputStream.close();
} catch (Exception e) {
throw e;
}
}

/**
* 查看PDF
*
* @param id 附件id
*/
@RequestMapping(value = "pdf/{id}")
public void pdfView(@PathVariable String id, HttpServletRequest request, HttpServletResponse response) throws Exception {
if (StringUtils.isBlank(id)){
return;
}
Attachment attachment = attachmentService.getModel(id);


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