基于javaweb+mysql的ssm+maven汽车保险理赔管理系统(java+ssm+jsp+bootstrap+jquery+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM+Maven汽车保险理赔管理系统(java+ssm+jsp+bootstrap+jquery+mysql)
项目介绍
本项目包含管理员、财务、用户、审核人员、外派人员等多种角色;
管理员角色包含以下功能: 管理员登陆,用户管理,理赔知识管理,理赔账单管理等功能。
财务角色包含以下功能: 财务登录,理赔发放等功能。
用户角色包含以下功能: 用户登录,我的保险,理赔知识查看,个人信息以及密码修改,提交的保单管理,理赔账单管理等功能。
审核人员角色包含以下功能: 事故认定审核,审核人员登录,理赔审核等功能。
外派人员角色包含以下功能: 外派人员登录,外派审核管理等功能。 PS:流程是用户提交理赔表单,审核人员审核,外派人员登录后认定结果,然后审核人员再次审核并给出赔偿金额,最后财务登录发放赔偿。
环境需要
1.运行环境:java jdk 7;注:本项目暂只支持jdk7,其它jdk版本暂不支持;。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.0;注:本项目暂只支持Tomcat 7.0,其它版本暂不支持; 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:是;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+jquery+bootstrap
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ssm_insurance_sys 登录
* @return
*/
@RequestMapping(value = "/update")
public String update(Integer id,Model model) {
Notice obj = noticeService.load(id);
model.addAttribute("obj",obj);
return "notice/update";
}
/**
* 添加修改
* @return
*/
@RequestMapping(value = "/exUpdate")
public String exUpdate(Notice notice, Model model, HttpServletRequest request, HttpServletResponse response) {
//1.通过实体类修改,可以多传修改条件
noticeService.updateById(notice);
//2.通过主键id修改
//noticeService.updateById(notice);
return "redirect:/notice/findBySql.action";
}
/**
* 删除通过主键
* @return
*/
@RequestMapping(value = "/delete")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
///1.通过主键删除
noticeService.deleteById(id);
return "redirect:/notice/findBySql.action";
}
}
* @param password
* @return
*/
@RequestMapping("/upass")
@ResponseBody
public String upass(HttpServletRequest request,String password){
Object attribute = request.getSession().getAttribute("userId");
JSONObject j = new JSONObject();
if (attribute == null){
j.put("res", 0);
return j.toString();
}
Integer userId = Integer.valueOf(attribute.toString());
User byId = userService.getById(userId);
byId.setPassword(password);
userService.updateById(byId);
j.put("res", 1);
return j.toString();
}
@RequestMapping(value = "/exUpdate2")
public String exUpdate2(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
Object attribute = request.getSession().getAttribute("userId");
if (attribute == null){
return "redirect:/login/login.action";
}
Integer userId = Integer.valueOf(attribute.toString());
//1.通过实体类修改,可以多传修改条件
user.setId(userId);
userService.updateById(user);
//2.通过主键id修改
//userService.updateById(user);
return "redirect:/user/view.action";
}
/**
* 添加修改
* @return
*/
@RequestMapping(value = "/exUpdate")
public String exUpdate(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
//1.通过实体类修改,可以多传修改条件
userService.updateById(user);
//2.通过主键id修改
//userService.updateById(user);
return "redirect:/user/findBySql.action";
}
/**
* 删除通过主键
* @return
* @return
*/
@RequestMapping(value = "/findByMap")
public String findByMap(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
//通过map查询
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(workOrder.getUserId())){
params.put("userId", workOrder.getUserId());
}
if(!isEmpty(workOrder.getCode())){
params.put("code", workOrder.getCode());
}
if(!isEmpty(workOrder.getAddress())){
params.put("address", workOrder.getAddress());
}
if(!isEmpty(workOrder.getShrId())){
params.put("shrId", workOrder.getShrId());
}
if(!isEmpty(workOrder.getWprId())){
params.put("wprId", workOrder.getWprId());
}
if(!isEmpty(workOrder.getCwrId())){
params.put("cwrId", workOrder.getCwrId());
}
if(!isEmpty(workOrder.getStatus())){
params.put("status", workOrder.getStatus());
}
if(!isEmpty(workOrder.getMoney())){
params.put("money", workOrder.getMoney());
}
if(!isEmpty(workOrder.getContent())){
params.put("content", workOrder.getContent());
}
//分页查询
Pager<WorkOrder> pagers = workOrderService.findByMap(params);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", workOrder);
return "workOrder/workOrder";
}
/**********************************【增删改】******************************************************/
}
if(!isEmpty(bxOrder.getMoney())){
sql += " and money like '%"+bxOrder.getMoney()+"%'";
}
if(!isEmpty(bxOrder.getShTime())){
sql += " and shTime like '%"+bxOrder.getShTime()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<BxOrder> pagers = bxOrderService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", bxOrder);
return "bxOrder/bxOrder2";
}
}
@Controller
@RequestMapping("/login")
public class LoginController extends BaseController{
@Autowired
private UserService userService;
/**
* 跳转登陆
* @return
*/
@RequestMapping("/login")
public String login(){
return "login/login";
}
@RequestMapping("/mtuichu")
public String mtuichu(HttpServletRequest request){
///1.通过主键删除
noticeService.deleteById(id);
return "redirect:/notice/findBySql.action";
}
}
/**
* @ClassName:
* @Description:
*/
@Controller
* 添加执行
* @return
*/
@RequestMapping(value = "/exAdd")
public String exAdd(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
userService.insert(user);
return "redirect:/user/findBySql.action";
}
/**
* 跳至修改页面
* @return
*/
@RequestMapping(value = "/update")
public String update(Integer id,Model model) {
User obj = userService.load(id);
model.addAttribute("obj",obj);
return "user/update";
}
@RequestMapping(value = "/pass")
public String pass(Integer id,HttpServletRequest request,Model model) {
Object attribute = request.getSession().getAttribute("userId");
if (attribute == null){
return "redirect:/login/login";
}
Integer userId = Integer.valueOf(attribute.toString());
User byId = userService.getById(userId);
model.addAttribute("obj",byId);
return "user/pass";
}
/**
* 修改密码
* @param request
* @param password
* @return
*/
@RequestMapping("/upass")
@ResponseBody
public String upass(HttpServletRequest request,String password){
Object attribute = request.getSession().getAttribute("userId");
JSONObject j = new JSONObject();
if (attribute == null){
j.put("res", 0);
return j.toString();
}
/*@RequestMapping("/upass")
@ResponseBody
public String upass(HttpServletRequest request,String password){
Object attribute = request.getSession().getAttribute("userId");
JSONObject j = new JSONObject();
if (attribute == null){
j.put("res", 0);
return j.toString();
}
Integer userId = Integer.valueOf(attribute.toString());
User load = userService.load(userId);
load.setPassWord(password);
userService.updateById(load);
j.put("res", 1);
return j.toString();
}*/
/**
* 退出
* @param request
* @param response
* @return
*/
@RequestMapping("/tuichu")
public String tuichu( HttpServletRequest request, HttpServletResponse response){
HttpSession session = request.getSession();
session.invalidate();
return "login/login";
}
@RequestMapping("/uTui")
public String uTui( HttpServletRequest request, HttpServletResponse response){
HttpSession session = request.getSession();
session.invalidate();
return "redirect:/login/uLogin.action";
}
@RequestMapping("/head")
private String head(){
return "inc/head";
}
@RequestMapping("/left")
private String left(){
return "inc/left";
}
*/
//shrsh2
@RequestMapping(value = "/shrsh2")
public String shrsh2(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
WorkOrder obj = workOrderService.load(workOrder.getId());
model.addAttribute("obj",obj);
return "workOrder/shrsh2";
}
/**
* 审核人员 理赔审核
* @param workOrder
* @param model
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/toshrsh2")
public String toshrsh2(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
Object attribute = request.getSession().getAttribute("userId");
//查询这个人的所有保险
if (attribute == null){
return "redirect:/login/login.action";
}
Integer userId = Integer.valueOf(attribute.toString());
WorkOrder obj = workOrderService.load(workOrder.getId());
obj.setStatus(workOrder.getStatus());
obj.setShrId(userId);
obj.setMoney(workOrder.getMoney());
workOrderService.updateById(obj);
return "redirect:/workOrder/shfindBySql2.action";
}
/**
* 审核人员 事故认定审核
*/
//shrsh
@RequestMapping(value = "/toshrsh")
public String toshrsh(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
Object attribute = request.getSession().getAttribute("userId");
//查询这个人的所有保险
if (attribute == null){
return "redirect:/login/login.action";
Integer userId = Integer.valueOf(attribute.toString());
WorkOrder obj = workOrderService.load(workOrder.getId());
obj.setStatus(4);
obj.setWprId(userId);
obj.setContent(workOrder.getContent());
workOrderService.updateById(obj);
return "redirect:/workOrder/wprfindBySql.action";
}
/**
* 财务人员确定
* @param workOrder
* @param model
* @param request
* @param response
* @return
* @throws Exception
*/
//cwryqr
@RequestMapping(value = "/cwryqr")
public String cwryqr(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
Object attribute = request.getSession().getAttribute("userId");
//查询这个人的所有保险
if (attribute == null){
return "redirect:/login/login.action";
}
Integer userId = Integer.valueOf(attribute.toString());
WorkOrder obj = workOrderService.load(workOrder.getId());
obj.setStatus(7);
obj.setCwrId(userId);
workOrderService.updateById(obj);
//新建订单记录
BxOrder entity = new BxOrder();
entity.setCode(obj.getCode());
entity.setMoney(obj.getMoney());
entity.setName(obj.getBx().getName());
entity.setShTime(DateUtil.format(new Date()));
entity.setUserId(obj.getUserId());
bxOrderService.insert(entity);
//发短信
// Message m = new Message();
// m.setCode("c2258140dc1211e8ef7e026a05d84ace");
// m.setContent("您购买的保单号为:“"+obj.getCode()+"”名称为:<<"+obj.getBx().getName()+">>已经理赔审核通过,请尽快去就近领取点领取。");
// m.setPhone(obj.getUser().getPhone());
// m.setUserName(obj.getUser().getUsername());
// String httpPostRequestStr = HttpClientUtil.sendPost(HttpClientUtil.URL, JSON.toJSONString(m));
// System.out.println(httpPostRequestStr);
request.setAttribute("msg", "发放成功");
return "workOrder/cwfindBySql";
}
/**
}
/**
* 财务人员cwfindBySql
*/
@RequestMapping(value = "/cwfindBySql")
public String cwfindBySql(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
//分页查询
Object attribute = request.getSession().getAttribute("userId");
if (attribute == null){
return "redirect:/login/login.action";
}
Integer userId = Integer.valueOf(attribute.toString());
String sql = "SELECT * FROM work_order WHERE status= 5";
if(!isEmpty(workOrder.getUserId())){
sql += " and userId like '%"+workOrder.getUserId()+"%'";
}
if(!isEmpty(workOrder.getCode())){
sql += " and code like '%"+workOrder.getCode()+"%'";
}
if(!isEmpty(workOrder.getAddress())){
sql += " and address like '%"+workOrder.getAddress()+"%'";
}
if(!isEmpty(workOrder.getShrId())){
sql += " and shrId like '%"+workOrder.getShrId()+"%'";
}
if(!isEmpty(workOrder.getWprId())){
sql += " and wprId like '%"+workOrder.getWprId()+"%'";
}
if(!isEmpty(workOrder.getCwrId())){
sql += " and cwrId like '%"+workOrder.getCwrId()+"%'";
}
if(!isEmpty(workOrder.getStatus())){
sql += " and status like '%"+workOrder.getStatus()+"%'";
}
if(!isEmpty(workOrder.getMoney())){
sql += " and money like '%"+workOrder.getMoney()+"%'";
}
if(!isEmpty(workOrder.getContent())){
sql += " and content like '%"+workOrder.getContent()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<WorkOrder> pagers = workOrderService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", workOrder);
return "workOrder/cwfindBySql";
}
* @param response
* @return
*/
@RequestMapping(value = "/findByMap")
public String findByMap(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
//通过map查询
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(workOrder.getUserId())){
params.put("userId", workOrder.getUserId());
}
if(!isEmpty(workOrder.getCode())){
params.put("code", workOrder.getCode());
}
if(!isEmpty(workOrder.getAddress())){
params.put("address", workOrder.getAddress());
}
if(!isEmpty(workOrder.getShrId())){
params.put("shrId", workOrder.getShrId());
}
if(!isEmpty(workOrder.getWprId())){
params.put("wprId", workOrder.getWprId());
}
if(!isEmpty(workOrder.getCwrId())){
params.put("cwrId", workOrder.getCwrId());
}
if(!isEmpty(workOrder.getStatus())){
params.put("status", workOrder.getStatus());
}
if(!isEmpty(workOrder.getMoney())){
params.put("money", workOrder.getMoney());
}
if(!isEmpty(workOrder.getContent())){
params.put("content", workOrder.getContent());
}
//分页查询
Pager<WorkOrder> pagers = workOrderService.findByMap(params);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", workOrder);
return "workOrder/workOrder";
}
* @return
*/
@RequestMapping(value = "/findBySql")
public String findBySql(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
//分页查询
Object attribute = request.getSession().getAttribute("userId");
if (attribute == null){
return "redirect:/login/login.action";
}
Integer userId = Integer.valueOf(attribute.toString());
String sql = "SELECT * FROM work_order WHERE userId= "+userId;
if(!isEmpty(workOrder.getUserId())){
sql += " and userId like '%"+workOrder.getUserId()+"%'";
}
if(!isEmpty(workOrder.getCode())){
sql += " and code like '%"+workOrder.getCode()+"%'";
}
if(!isEmpty(workOrder.getAddress())){
sql += " and address like '%"+workOrder.getAddress()+"%'";
}
if(!isEmpty(workOrder.getShrId())){
sql += " and shrId like '%"+workOrder.getShrId()+"%'";
}
if(!isEmpty(workOrder.getWprId())){
sql += " and wprId like '%"+workOrder.getWprId()+"%'";
}
if(!isEmpty(workOrder.getCwrId())){
sql += " and cwrId like '%"+workOrder.getCwrId()+"%'";
}
if(!isEmpty(workOrder.getStatus())){
sql += " and status like '%"+workOrder.getStatus()+"%'";
}
if(!isEmpty(workOrder.getMoney())){
sql += " and money like '%"+workOrder.getMoney()+"%'";
}
if(!isEmpty(workOrder.getContent())){
sql += " and content like '%"+workOrder.getContent()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<WorkOrder> pagers = workOrderService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", workOrder);
return "workOrder/workOrder";
}
/**
* 审核员事故认定审核
* @param workOrder
* @param model
* @param request
* @param response
sql += " and shTime like '%"+bxOrder.getShTime()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<BxOrder> pagers = bxOrderService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", bxOrder);
return "bxOrder/bxOrder";
}
//findBySql2
/**
* 用户端的账单
*/
@RequestMapping(value = "/findBySql2")
public String findBySql2(BxOrder bxOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
//分页查询
Object attribute = request.getSession().getAttribute("userId");
//查询这个人的所有保险
if (attribute == null){
return "redirect:/login/login.action";
}
Integer userId = Integer.valueOf(attribute.toString());
String sql = "SELECT * FROM bx_order WHERE 1=1 and userId = "+userId;
if(!isEmpty(bxOrder.getUserId())){
sql += " and userId like '%"+bxOrder.getUserId()+"%'";
}
if(!isEmpty(bxOrder.getName())){
sql += " and name like '%"+bxOrder.getName()+"%'";
}
if(!isEmpty(bxOrder.getCode())){
sql += " and code like '%"+bxOrder.getCode()+"%'";
}
if(!isEmpty(bxOrder.getMoney())){
sql += " and money like '%"+bxOrder.getMoney()+"%'";
}
if(!isEmpty(bxOrder.getShTime())){
sql += " and shTime like '%"+bxOrder.getShTime()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<BxOrder> pagers = bxOrderService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", bxOrder);
return "bxOrder/bxOrder2";
}
/**
* @ClassName:
* @Description:
*/
@Controller
@RequestMapping("/bx")
public class BxController extends BaseController {
/**
* 依赖注入 start dao/service/===
@ResponseBody
@RequestMapping(value = "/saveFile")
public Map<String, Object> saveFile(@RequestParam(value = "upfile", required = false) MultipartFile file,HttpServletRequest request, Model model) throws IllegalStateException, IOException {
Map<String, Object> params = new HashMap<String, Object>();
System.out.println("开始");
long startTime=System.currentTimeMillis();
System.out.println("fileName:"+file.getOriginalFilename());
String n = UUIDUtils.create();
String path="D:/my/ueditor/"+n+file.getOriginalFilename();
System.out.println("===================================================");
System.out.println(path);
File newFile=new File(path);
//通过CommonsMultipartFile的方法直接写文件(注意这个时候)
file.transferTo(newFile);
String visitUrl = "/ueditor/";
visitUrl = visitUrl.concat(n+file.getOriginalFilename());
long endTime=System.currentTimeMillis();
System.out.println("方法二的运行时间:"+String.valueOf(endTime-startTime)+"ms");
System.out.println("*********************************************************");
System.out.println("*********************************************************");
params.put("state", "SUCCESS");
params.put("url", visitUrl);
params.put("size", file.getSize());
params.put("original", file.getOriginalFilename());
params.put("type", file.getContentType());
return params;
}
}
* 删除通过主键
* @return
*/
@RequestMapping(value = "/delete")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
///1.通过主键删除
workOrderService.deleteById(id);
return "redirect:/workOrder/findBySql.action";
}
}
/**
* @ClassName:
* @Description:
}
sql += " ORDER BY ID DESC ";
Pager<WorkOrder> pagers = workOrderService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", workOrder);
return "workOrder/cwfindBySql";
}
/**
* 分页查询 返回list对象(通过Map)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByMap")
public String findByMap(WorkOrder workOrder, Model model, HttpServletRequest request, HttpServletResponse response) {
//通过map查询
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(workOrder.getUserId())){
params.put("userId", workOrder.getUserId());
}
if(!isEmpty(workOrder.getCode())){
params.put("code", workOrder.getCode());
}
if(!isEmpty(workOrder.getAddress())){
params.put("address", workOrder.getAddress());
}
if(!isEmpty(workOrder.getShrId())){
params.put("shrId", workOrder.getShrId());
}
if(!isEmpty(workOrder.getWprId())){
params.put("wprId", workOrder.getWprId());
}
if(!isEmpty(workOrder.getCwrId())){
params.put("cwrId", workOrder.getCwrId());
}
if(!isEmpty(workOrder.getStatus())){
params.put("status", workOrder.getStatus());
}
if(!isEmpty(workOrder.getMoney())){
params.put("money", workOrder.getMoney());
}
if(!isEmpty(workOrder.getContent())){
params.put("content", workOrder.getContent());
}
//分页查询