Java project: auto insurance claim management system (java+ssm+jsp+bootstrap+jquery+mysql)

qq1334611189 2022-06-23 18:53:48 阅读数:668

javaprojectautoinsuranceclaim

The source code for : My blog home page " resources " Download !

Project introduction

This project includes administrators 、 financial 、 user 、 Reviewers 、 Expatriates and other roles ;

The administrator role includes the following functions :
Administrator login , User management , Claims knowledge management , Claim bill management and other functions .

The financial role includes the following functions :
Financial login , Claim distribution and other functions .

User roles include the following functions :
The user login , My insurance , Claim knowledge view , Personal information and password modification , Submitted policy management , Claim bill management and other functions .

The auditor role includes the following functions :
Accident identification audit , Auditors log in , Claims audit and other functions .

The expatriate role includes the following functions :
Expatriates log in , Expatriate audit management and other functions .
PS: The process is that the user submits a claim form , Reviewed by reviewer , The confirmation result after the expatriate logs in , Then the reviewer reviews again and gives the compensation amount , Finally, the financial department logs in and pays compensation .


Environmental needs

1. Running environment :java jdk 7; notes : This project only supports jdk7, Other jdk Version does not support ;.
2.IDE Environmental Science :IDEA,Eclipse,Myeclipse Fine . recommend IDEA;
3.tomcat Environmental Science :Tomcat 7.0; notes : This project only supports Tomcat 7.0, Other versions do not support ;
4. Hardware environment :windows 7/8/10 1G Above memory ; perhaps Mac OS; 
5. database :MySql 5.7 edition ;
6. whether Maven project : yes ;


Technology stack

1. Back end :Spring+SpringMVC+Mybatis
2. front end :JSP+CSS+JavaScript+jquery+bootstrap


Instructions

1. Use Navicat Or other tools , stay mysql Create a database with the corresponding name in , And import the sql file ;
2. Use IDEA/Eclipse/MyEclipse Import the project ,Eclipse/MyEclipse Import time , if maven Item, please select maven;
if maven project , After importing successfully, please execute maven clean;maven install command , And then run ;
3. In the project db.properties Change the database configuration in the configuration file to your own configuration ;
4. Run the project , Input localhost:8080/ssm_insurance_sys Sign in

 

 

 

 

 

User management control layer :

@Controller
@RequestMapping("/user")
public class UserController extends BaseController {
/**
* Dependency injection start dao/service/===
*/
@Autowired
private UserService userService;
/**
* Paging query return list object ( Through to By Sql)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findBySql")
public String findBySql(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
// Paging query
String sql = "SELECT * FROM user WHERE 1=1 ";
if(!isEmpty(user.getUsername())){
sql += " and username like '%"+user.getUsername()+"%'";
}
if(!isEmpty(user.getPassword())){
sql += " and password like '%"+user.getPassword()+"%'";
}
if(!isEmpty(user.getPhone())){
sql += " and phone like '%"+user.getPhone()+"%'";
}
if(!isEmpty(user.getRole())){
sql += " and role like '%"+user.getRole()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<User> pagers = userService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
// Store query criteria
model.addAttribute("obj", user);
return "user/user";
}
/**
* Paging query return list object ( adopt Map)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByMap")
public String findByMap(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
// adopt map Inquire about
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(user.getUsername())){
params.put("username", user.getUsername());
}
if(!isEmpty(user.getPassword())){
params.put("password", user.getPassword());
}
if(!isEmpty(user.getPhone())){
params.put("phone", user.getPhone());
}
if(!isEmpty(user.getRole())){
params.put("role", user.getRole());
}
// Paging query
Pager<User> pagers = userService.findByMap(params);
model.addAttribute("pagers", pagers);
// Store query criteria
model.addAttribute("obj", user);
return "user/user";
}
/**********************************【 Additions and deletions 】******************************************************/
/**
* Skip to the add page
* @return
*/
@RequestMapping(value = "/add")
public String add() {
return "user/add";
}
/**
* Jump to the details page
* @return
*/
@RequestMapping(value = "/view")
public String view(Integer id,Model model,HttpServletRequest request) {
Object attribute = request.getSession().getAttribute("userId");
if (attribute == null){
return "redirect:/login/login.action";
}
Integer userId = Integer.valueOf(attribute.toString());
User obj = userService.load(userId);
model.addAttribute("obj",obj);
return "user/view";
}
/**
* Add execution
* @return
*/
@RequestMapping(value = "/exAdd")
public String exAdd(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
userService.insert(user);
return "redirect:/user/findBySql.action";
}
/**
* Skip to the modification page
* @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";
}
/**
* Change Password
* @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();
}
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. Modify through entity class , You can transfer multiple modification conditions
user.setId(userId);
userService.updateById(user);
//2. Through primary key id modify
//userService.updateById(user);
return "redirect:/user/view.action";
}
/**
* Add modification
* @return
*/
@RequestMapping(value = "/exUpdate")
public String exUpdate(User user, Model model, HttpServletRequest request, HttpServletResponse response) {
//1. Modify through entity class , You can transfer multiple modification conditions
userService.updateById(user);
//2. Through primary key id modify
//userService.updateById(user);
return "redirect:/user/findBySql.action";
}
/**
* Delete through primary key
* @return
*/
@RequestMapping(value = "/delete")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
///1. Delete... By primary key
userService.deleteById(id);
return "redirect:/user/findBySql.action";
}
}

Login management control layer :

@Controller
@RequestMapping("/login")
public class LoginController extends BaseController{
@Autowired
private UserService userService;
/**
* Jump landing
* @return
*/
@RequestMapping("/login")
public String login(){
return "login/login";
}
@RequestMapping("/mtuichu")
public String mtuichu(HttpServletRequest request){
//request.getSession().invalidate();
return "login/mLogin";
}
@RequestMapping("/welcome")
private String welcome(){
return "login/welcome";
}
@RequestMapping("/utoLogin")
public String utoLogin(User manage, HttpServletRequest request, HttpServletResponse response){
User byEntity = userService.getByEntity(manage);
if(byEntity == null){
return "redirect:/login/login.action";
}else{
request.getSession().setAttribute("role", byEntity.getRole());
request.getSession().setAttribute("userId", byEntity.getId());
request.getSession().setAttribute("username", byEntity.getUsername());
}
return "login/index";
}
@RequestMapping("/pass")
public String pass(HttpServletRequest request){
Object attribute = request.getSession().getAttribute("userId");
if (attribute == null){
return "redirect:/login/uLogin.action";
}
Integer userId = Integer.valueOf(attribute.toString());
User load = userService.load(userId);
request.setAttribute("obj", load);
return "login/pass";
}
/*@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();
}*/
/**
* sign out
* @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";
}
@RequestMapping("/main")
private String main(HttpServletRequest request){
Object attribute = request.getSession().getAttribute("userId");
if (attribute == null){
return "redirect:/login/uLogin.action";
}
Integer userId = Integer.valueOf(attribute.toString());
User load = userService.load(userId);
request.setAttribute("user", load);
return "login/main";
}
@RequestMapping("/info")
private String info(HttpServletRequest request){
Object attribute = request.getSession().getAttribute("userId");
Integer userId = Integer.valueOf(attribute.toString());
User load = userService.load(userId);
request.setAttribute("user", load);
return "login/info";
}
}

Insurance management control layer :

@Controller
@RequestMapping("/bx")
public class BxController extends BaseController {
/**
* Dependency injection start dao/service/===
*/
@Autowired
private BxService bxService;
/**
* Paging query return list object ( Through to By Sql)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findBySql")
public String findBySql(Bx bx, 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());
// Paging query
String sql = "SELECT * FROM bx WHERE 1=1 and userId = "+userId;
if(!isEmpty(bx.getUserId())){
sql += " and userId like '%"+bx.getUserId()+"%'";
}
if(!isEmpty(bx.getName())){
sql += " and name like '%"+bx.getName()+"%'";
}
if(!isEmpty(bx.getType())){
sql += " and type like '%"+bx.getType()+"%'";
}
if(!isEmpty(bx.getMoney())){
sql += " and money like '%"+bx.getMoney()+"%'";
}
if(!isEmpty(bx.getCode())){
sql += " and code like '%"+bx.getCode()+"%'";
}
if(!isEmpty(bx.getStartTime())){
sql += " and startTime like '%"+bx.getStartTime()+"%'";
}
if(!isEmpty(bx.getEndTime())){
sql += " and endTime like '%"+bx.getEndTime()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<Bx> pagers = bxService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
// Store query criteria
model.addAttribute("obj", bx);
return "bx/bx";
}
/**
* Paging query return list object ( adopt Map)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByMap")
public String findByMap(Bx bx, Model model, HttpServletRequest request, HttpServletResponse response) {
// adopt map Inquire about
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(bx.getUserId())){
params.put("userId", bx.getUserId());
}
if(!isEmpty(bx.getName())){
params.put("name", bx.getName());
}
if(!isEmpty(bx.getType())){
params.put("type", bx.getType());
}
if(!isEmpty(bx.getMoney())){
params.put("money", bx.getMoney());
}
if(!isEmpty(bx.getCode())){
params.put("code", bx.getCode());
}
if(!isEmpty(bx.getStartTime())){
params.put("startTime", bx.getStartTime());
}
if(!isEmpty(bx.getEndTime())){
params.put("endTime", bx.getEndTime());
}
// Paging query
Pager<Bx> pagers = bxService.findByMap(params);
model.addAttribute("pagers", pagers);
// Store query criteria
model.addAttribute("obj", bx);
return "bx/bx";
}
/**********************************【 Additions and deletions 】******************************************************/
/**
* Skip to the add page
* @return
*/
@RequestMapping(value = "/add")
public String add() {
return "bx/add";
}
/**
* Jump to the details page
* @return
*/
@RequestMapping(value = "/view")
public String view(Integer id,Model model) {
Bx obj = bxService.load(id);
model.addAttribute("obj",obj);
return "bx/view";
}
/**
* Add execution
* @return
*/
@RequestMapping(value = "/exAdd")
public String exAdd(Bx bx, Model model, HttpServletRequest request, HttpServletResponse response) {
bxService.insert(bx);
return "redirect:/bx/findBySql.action";
}
/**
* Skip to the modification page
* @return
*/
@RequestMapping(value = "/update")
public String update(Integer id,Model model) {
Bx obj = bxService.load(id);
model.addAttribute("obj",obj);
return "bx/update";
}
/**
* Add modification
* @return
*/
@RequestMapping(value = "/exUpdate")
public String exUpdate(Bx bx, Model model, HttpServletRequest request, HttpServletResponse response) {
//1. Modify through entity class , You can transfer multiple modification conditions
bxService.updateById(bx);
//2. Through primary key id modify
//bxService.updateById(bx);
return "redirect:/bx/findBySql.action";
}
/**
* Delete through primary key
* @return
*/
@RequestMapping(value = "/delete")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
///1. Delete... By primary key
bxService.deleteById(id);
return "redirect:/bx/findBySql.action";
}
}

The source code for : My blog home page " resources " Download !

版权声明:本文为[qq1334611189]所创,转载请带上原文链接,感谢。 https://javamana.com/2022/174/202206231752257232.html