保险业务管理系统|基于JavaWeb保险业务管理系统的设计与实现(一)https://developer.aliyun.com/article/1423384
package com.InsuranceBusiness.action; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.interceptor.ServletResponseAware; import org.apache.struts2.interceptor.SessionAware; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import com.InsuranceBusiness.model.ProductList; import com.InsuranceBusiness.service.ProductListService; import com.opensymphony.xwork2.ActionSupport; @Component(value="ProductListAction") @Scope(value = "prototype") public class ProductListAction extends ActionSupport implements SessionAware,ServletResponseAware{ private Map<String, Object> session; public Map<String, Object> getSession() { return session; } public void setSession(Map<String, Object> session) { this.session = session; } private HttpServletResponse response; public void setServletResponse(HttpServletResponse response) { this.response = response; } private ProductListService productListService; public ProductListService getProductListService() { return productListService; } @Resource(name="ProductListService") public void setProductListService(ProductListService productListService) { this.productListService = productListService; } private ProductList productlist; public ProductList getProductlist() { return productlist; } public void setProductlist(ProductList productlist) { this.productlist = productlist; } private String pid; public String getPid() { return pid; } public void setPid(String pid) { this.pid = pid; } public String addProduct(){ productListService.addProduct(productlist); return SUCCESS; } public String selProductList(){ List<ProductList> plist = productListService.selProductList(); session.put("plist", plist); return SUCCESS; } public String delProduct(){ productListService.delProduct(pid); return SUCCESS; } }
package com.InsuranceBusiness.action; import java.io.UnsupportedEncodingException; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.interceptor.ServletResponseAware; import org.apache.struts2.interceptor.SessionAware; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import com.InsuranceBusiness.model.OrderList; import com.InsuranceBusiness.model.UserList; import com.InsuranceBusiness.service.OrderListService; import com.opensymphony.xwork2.ActionSupport; @Component(value="OrderListAction") @Scope(value = "prototype") public class OrderListAction extends ActionSupport implements SessionAware,ServletResponseAware{ private Map<String, Object> session; public Map<String, Object> getSession() { return session; } public void setSession(Map<String, Object> session) { this.session = session; } private HttpServletResponse response; public void setServletResponse(HttpServletResponse response) { this.response = response; } private OrderListService orderListService; public OrderListService getOrderListService() { return orderListService; } @Resource(name="OrderListService") public void setOrderListService(OrderListService orderListService) { this.orderListService = orderListService; } private String pid; public String getPid() { return pid; } public void setPid(String pid) { this.pid = pid; } private String pname; public String getPname() { return pname; } public void setPname(String pname) { this.pname = pname; } private String pcost; public String getPcost() { return pcost; } public void setPcost(String pcost) { this.pcost = pcost; } private String oid; public String getOid() { return oid; } public void setOid(String oid) { this.oid = oid; } public String addOrder(){ UserList ul = (UserList)session.get("login"); OrderList ol = new OrderList(); try { ol.setOrder_name(new String(pname.getBytes("iso8859-1"),"utf-8")); ol.setOrder_cost(pcost); ol.setProduct_id(pid); ol.setOrder_uid(String.valueOf(ul.getUser_id())); ol.setOrder_uname(ul.getName()); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } orderListService.addOrder(ol); return SUCCESS; } public String selOrderListByMe(){ UserList ul = (UserList)session.get("login"); List<OrderList> olist = orderListService.selOrderList(String.valueOf(ul.getUser_id()), "'0','1','2','n','9'"); session.put("olist", olist); return SUCCESS; } public String qrOrder(){ orderListService.updateOrder(oid, "1"); return SUCCESS; } public String delOrder(){ orderListService.delOrder(oid); return SUCCESS; } public String selOrderList(){ List<OrderList> olist = orderListService.selOrderList("'0','1','2','n','9'"); session.put("olist", olist); return SUCCESS; } public String selCompensateListByMe(){ UserList ul = (UserList)session.get("login"); List<OrderList> clist = orderListService.selOrderList(String.valueOf(ul.getUser_id()), "'1','2','n','9'"); session.put("clist", clist); return SUCCESS; } public String selCompensateList(){ List<OrderList> clist = orderListService.selOrderList("'2','n','9'"); session.put("clist", clist); return SUCCESS; } public String applyPayment(){ orderListService.updateOrder(oid, "2"); return SUCCESS; } public String agreeCom(){ orderListService.updateOrder(oid, "9"); return SUCCESS; } public String disagreeCom(){ orderListService.updateOrder(oid, "n"); return SUCCESS; } }
五,项目总结
关于对保险业务信息管理的调研,选择了利用SSH框架编写,mysql作为数据库来进行保险业务管理系统的设计本系统主要分为保险业务管理和后台管理两部分,其中保险业务管理可以进行查看/购买保险产品信息、查看/确认订单信息、查看/申请赔偿信息、管理个人信息。后台管理部分主要是管理员进行登录管理员用户,从而进行管理,而管理员的权限可分为保险信息管理、订单信息管理、赔偿信息管理、用户信息管理。具体的功能结构图如图4-3所示。