springboot详解实现车险理赔信息管理系统代码
作者:编程指南针
本系统基于Springboot开发实现了一个为用户车险进行理赔信息管理的一个信息化管理系统,核心的业务主要是用户申请保险理赔,管理员审核进入理赔程序,事故调查员对事故进行调查和现场勘察,这其中共涉及到三类用户,购买保险的客户,事故调查员和系统管理员
一,项目简介
客户的主要功能:个人资料管理,购买的保险信息管理,理赔的申请
事故调查员功能:个人资料管理,事故调查管理,现场勘察管理
管理员功能:个人资料管理,用户管理,理赔审请审核,赔偿金发放管理
二,环境介绍
语言环境:Java: jdk1.8
数据库:Mysql: mysql5.7
应用服务器:Tomcat: tomcat8.5.31
开发工具:IDEA或eclipse
开发技术:后台springboot+springmvvc+mybatis
前台:layui+jquery+jsp
三,系统展示
用户登陆:
用户注册
个人资料管理
车险管理
理赔记录管理
管理员管理功能:
用户管理
理赔审核
赔偿金发放
事故调查员功能
事故调查
现场勘察管理
四,核心代码展示
package com.controller; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.InitializingBean; import com.entity.Insurance; import com.service.InsuranceService; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import java.util.List; import com.entity.Result; import com.utils.ResultUtil; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import com.entity.User; import java.util.Date; import com.github.pagehelper.PageHelper; import org.springframework.web.bind.annotation.RequestParam; import com.github.pagehelper.PageInfo; /** * ZNZ */ @Controller @RequestMapping(value = "/admin/insurance") public class AdminInsuranceController extends BaseController { @Autowired private InsuranceService insuranceService; @RequestMapping("add") public String add(HttpServletRequest request, Insurance model) { request.setAttribute("model", model); return "/admin/insurance-add"; } @RequestMapping("edit") public String edit(HttpServletRequest request, String id) { Insurance model = insuranceService.getModel(id); request.setAttribute("model", model); return "/admin/insurance-add"; } @RequestMapping("save") @ResponseBody public Result save(HttpServletRequest request, Insurance model) { User user = (User) request.getSession().getAttribute("user"); int i = 0; if (StringUtils.isBlank(model.getId())) { model.preInsert(); model.setCreateDate(new Date()); model.setUserId(user.getId()); i = insuranceService.insertModel(model); } else { i = insuranceService.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++) { insuranceService.deleteModel(split[i]); } return ResultUtil.success(); } else { return ResultUtil.error("未选中删除项!"); } } @RequestMapping("list") public String list(HttpServletRequest request, Insurance model) { request.setAttribute("model", model); return "/admin/insurance-list"; } //获取列表数据 @RequestMapping("list/data") @ResponseBody public Result list(HttpServletRequest request, Insurance model, @RequestParam(defaultValue = "1") Integer page, Integer limit) { User user = (User) request.getSession().getAttribute("user"); if (user.getType() == 0){ model.setUserId(user.getId()); } PageHelper.startPage(page, limit); List<Insurance> list = insuranceService.getModelList(putEntityInMap(model)); PageInfo<Insurance> pageInfo = new PageInfo<>(list); return ResultUtil.success(list, pageInfo.getTotal()); } }
package com.controller; import com.entity.*; import com.service.InsuranceService; import com.service.OrdersService; import com.utils.MapUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.InitializingBean; import com.service.InvestigationService; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import java.util.List; import com.utils.ResultUtil; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import java.util.Date; import com.github.pagehelper.PageHelper; import org.springframework.web.bind.annotation.RequestParam; import com.github.pagehelper.PageInfo; @Controller @RequestMapping(value="/admin/investigation") public class AdminInvestigationController extends BaseController { @Autowired private InvestigationService investigationService; @Autowired private OrdersService ordersService; @Autowired private InsuranceService insuranceService; @RequestMapping("add") public String add(HttpServletRequest request,Investigation model){ request.setAttribute("model",model); return "/admin/investigation-add"; } @RequestMapping("diaocha") public String diaocha(HttpServletRequest request,String id){ Orders model = ordersService.getModel(id); Insurance insurance = insuranceService.getModel(model.getInsuranceId()); request.setAttribute("model",model); 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); } } //删除批量删除 @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++) { investigationService.deleteModel(split[i]); } return ResultUtil.success(); }else { return ResultUtil.error("未选中删除项!"); } } @RequestMapping("list") public String list(HttpServletRequest request,Investigation model){ request.setAttribute("model",model); return "/admin/investigation-list"; } //获取列表数据 @RequestMapping("list/data") @ResponseBody public Result list(HttpServletRequest request,User model, @RequestParam(defaultValue = "1")Integer page,Integer limit){ PageHelper.startPage(page,limit); List<Investigation> list = investigationService.getModelList(putEntityInMap(model)); PageInfo<Investigation> pageInfo = new PageInfo<>(list); return ResultUtil.success(list,pageInfo.getTotal()); } }
package com.controller; import com.entity.Insurance; import com.service.InsuranceService; import com.service.UserService; import com.utils.MapUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.InitializingBean; import com.entity.Orders; import com.service.OrdersService; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.List; import com.entity.Result; import com.utils.ResultUtil; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import com.entity.User; import java.util.Date; import com.github.pagehelper.PageHelper; import org.springframework.web.bind.annotation.RequestParam; import com.github.pagehelper.PageInfo; @Controller @RequestMapping(value = "/admin/orders") public class AdminOrdersController extends BaseController { @Autowired private OrdersService ordersService; @Autowired private InsuranceService insuranceService; @Autowired private UserService userService; @RequestMapping("add") public String add(HttpServletRequest request, Orders model) { User user = (User) request.getSession().getAttribute("user"); List<Insurance> insuranceList = insuranceService.getModelList(MapUtil.buildMap("userId", user.getId())); request.setAttribute("model", model); request.setAttribute("insuranceList", insuranceList); return "/admin/orders-add"; } @RequestMapping("edit") public String edit(HttpServletRequest request, String id) { Orders model = ordersService.getModel(id); request.setAttribute("model", model); return "/admin/orders-add"; } @RequestMapping("save") @ResponseBody public Result save(HttpServletRequest request, Orders model) { User user = (User) request.getSession().getAttribute("user"); int i = 0; if (StringUtils.isBlank(model.getId())) { model.preInsert(); model.setCreateDate(new Date()); i = ordersService.insertModel(model); } else { i = ordersService.updateModel(model); } if (i == 0) { return ResultUtil.error("失败"); } else { return ResultUtil.success(null); } } @RequestMapping("approved") @ResponseBody public Result approved(String id,Integer state){ Orders model = ordersService.getModel(id); model.setState(state); if (state == 5){ getMoney(id); } int i = ordersService.updateModel(model); if (i == 0) { return ResultUtil.error("失败"); } else { return ResultUtil.success(null); } } /** * 发放赔偿金 */ public void getMoney(String orderId){ Orders orders = ordersService.getModel(orderId);//获取保单 User user = userService.getModel(orders.getUserId());//获取用户 BigDecimal price = orders.getPrice();//保单申请金额 user.setMoney(user.getMoney().add(price));//用户账户余额增加保费 userService.updateModel(user); } //删除批量删除 @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++) { ordersService.deleteModel(split[i]); } return ResultUtil.success(); } else { return ResultUtil.error("未选中删除项!"); } } @RequestMapping("list") public String list(HttpServletRequest request, Orders model) { request.setAttribute("model", model); return "/admin/orders-list"; } /** * 用户提交的申请理赔 * @param request * @param model * @return */ @RequestMapping("approve") public String approve(HttpServletRequest request, Orders model) { request.setAttribute("model", model); return "/admin/orders-approve"; } /** * 已经有调查勘察记录的申请单,确认是否发放赔偿金 * @param request * @param model * @return */ @RequestMapping("money/give") public String moneyGive(HttpServletRequest request, Orders model) { request.setAttribute("model", model); return "/admin/orders-money"; } /** * 用户提交的需要调查的 * @param request * @param model * @return */ @RequestMapping("investigation") public String investigation(HttpServletRequest request, Orders model) { request.setAttribute("model", model); return "/admin/orders-investigation"; } /** * 用户提交的需要调查的 * @param request * @param model * @return */ @RequestMapping("responsibility") public String responsibility(HttpServletRequest request, Orders model) { request.setAttribute("model", model); return "/admin/orders-responsibility"; } //获取列表数据 @RequestMapping("list/data") @ResponseBody public Result list(HttpServletRequest request, Orders model, @RequestParam(defaultValue = "1") Integer page, Integer limit) { PageHelper.startPage(page, limit); List<Orders> list = ordersService.getModelList(putEntityInMap(model)); PageInfo<Orders> pageInfo = new PageInfo<>(list); return ResultUtil.success(list, pageInfo.getTotal()); } }
五,项目总结
本项目基本上实现了车险理陪的主要核心业务,角色功能相对完整,适合做毕业设计或课程设计使用。
到此这篇关于springboot详解实现车险理赔信息管理系统代码的文章就介绍到这了,更多相关springboot车险理赔信息管理内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!