package com.action;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.bean.*;
import com.dao.*;
import com.util.DBO;
@Controller
@RequestMapping(value="/zichan")
public class zichanAction {
/**
* 自动注入业务逻辑层,注入方式使用了注解自动注入
*/
@Resource zichanDao zichandao;
@RequestMapping(value="/addPage")
public String addPage(zichan zichan,HttpServletRequest request){
Map<String,Object> map= new HashMap<String,Object>();
System.out.println("addPageok");
return "zichan/zichanadd";
}
@RequestMapping(value="/add")
public String add(zichan zichan,HttpServletRequest request){
Map<String,Object> map= new HashMap<String,Object>();
//String name=(String)request.getParameter("name");
map.put("zcid", zichan.getZcid());//资产编号
map.put("zcmc", zichan.getZcmc());//资产名称
map.put("js", zichan.getJs());//介绍
map.put("grrq", zichan.getGrrq());//购入日期
map.put("lb", zichan.getLb());//类别
map.put("jz", zichan.getJz());//价值
map.put("sl", zichan.getSl());//数量
map.put("bm", zichan.getBm());//部门
map.put("dj", zichan.getDj());
map.put("scrq", zichan.getScrq());
map.put("syqx", zichan.getSyqx());
map.put("cs", zichan.getCs());
String zcid=(String)zichan.getZcid();//资产编号
String zcmc=(String)zichan.getZcmc();//资产名称
String js=(String)zichan.getJs();//介绍
String grrq=(String)zichan.getGrrq();//购入日期
String lb=(String)zichan.getLb();//类别
String jz=(String)zichan.getJz();//价值
String sl=(String)zichan.getSl();//数量
String bm=(String)zichan.getBm();//部门
DBO db=new DBO();
String sql="";
ResultSet rs=null;
int num=0;
try{
sql="select count(1) as num from zichan where zcmc='"+zcmc+"'";
rs=db.query(sql);
if(rs.next()){
num=rs.getInt("num");
}
if(num>0){
request.setAttribute("msg", "<script>alert('添加失败、名称重复');</script>");
}else{
zichandao.save(map);
request.setAttribute("msg", "<script>alert('添加成功');</script>");
}
}catch(Exception e){
e.printStackTrace();
}finally{
db.close();
}
System.out.println("addok");
return "zichan/zichanadd";
}
/**删除
*
*/
@RequestMapping(value="/del")
public String del(Integer id,HttpServletRequest request,Map<String,Object> map){
// Map<String,Object> map= new HashMap<String,Object>();
String a=(String)request.getParameter("keyid");
id=Integer.parseInt(a);
request.setAttribute("msg", "<script>alert('删除成功');</script>");
zichandao.del(id);
return selectall(null,map,request);
}
/**
* 修改zichan信息
*/
@RequestMapping(value="/update")
public String update(zichan zichan,HttpServletRequest request,Map<String,Object> map1){
Map<String,Object> map= new HashMap<String,Object>();
map.put("zcid", zichan.getZcid());//资产编号
map.put("zcmc", zichan.getZcmc());//资产名称
map.put("js", zichan.getJs());//介绍
map.put("grrq", zichan.getGrrq());//购入日期
map.put("lb", zichan.getLb());//类别
map.put("jz", zichan.getJz());//价值
map.put("sl", zichan.getSl());//数量
map.put("bm", zichan.getBm());//部门
map.put("dj", zichan.getDj());
map.put("scrq", zichan.getScrq());
map.put("syqx", zichan.getSyqx());
map.put("cs", zichan.getCs());
String zcid=(String)zichan.getZcid();//资产编号
String zcmc=(String)zichan.getZcmc();//资产名称
String js=(String)zichan.getJs();//介绍
String grrq=(String)zichan.getGrrq();//购入日期
String lb=(String)zichan.getLb();//类别
String jz=(String)zichan.getJz();//价值
String sl=(String)zichan.getSl();//数量
String bm=(String)zichan.getBm();//部门
request.setAttribute("msg", "<script>alert('修改成功');</script>");
zichandao.update(map);
return selectall(null,map1,request);
}
/**
* 查询zichan信息
*/
@RequestMapping(value="/modify")
public String modify(Integer id,Map<String,Object> map,HttpServletRequest request){
String keyid=(String)request.getParameter("keyid");
List<Map<String,Object>> list= new ArrayList<Map<String,Object>>();
list=zichandao.select(Integer.parseInt(keyid));
request.setAttribute("zcid", list.get(0).get("zcid"));//资产编号
request.setAttribute("zcmc", list.get(0).get("zcmc"));//资产名称
request.setAttribute("js", list.get(0).get("js"));//介绍
request.setAttribute("grrq", list.get(0).get("grrq"));//购入日期
request.setAttribute("lb", list.get(0).get("lb"));//类别
request.setAttribute("jz", list.get(0).get("jz"));//价值
request.setAttribute("sl", list.get(0).get("sl"));//数量
request.setAttribute("bm", list.get(0).get("bm"));//部门
request.setAttribute("dj", list.get(0).get("dj"));
request.setAttribute("scrq", list.get(0).get("scrq"));
request.setAttribute("syqx", list.get(0).get("syqx"));
request.setAttribute("cs", list.get(0).get("cs"));
return "zichan/zichanmodify";
}
@RequestMapping(value="/detail")
public String detail(Integer id,Map<String,Object> map,HttpServletRequest request){
String keyid=(String)request.getParameter("keyid");
List<Map<String,Object>> list= new ArrayList<Map<String,Object>>();
list=zichandao.select(Integer.parseInt(keyid));
request.setAttribute("zcid", list.get(0).get("zcid"));//资产编号
request.setAttribute("zcmc", list.get(0).get("zcmc"));//资产名称
request.setAttribute("js", list.get(0).get("js"));//介绍
request.setAttribute("grrq", list.get(0).get("grrq"));//购入日期
request.setAttribute("lb", list.get(0).get("lb"));//类别
request.setAttribute("jz", list.get(0).get("jz"));//价值
request.setAttribute("sl", list.get(0).get("sl"));//数量
request.setAttribute("bm", list.get(0).get("bm"));//部门
request.setAttribute("dj", list.get(0).get("dj"));
request.setAttribute("scrq", list.get(0).get("scrq"));
request.setAttribute("syqx", list.get(0).get("syqx"));
request.setAttribute("cs", list.get(0).get("cs"));
return "zichan/zichandetail";
}
/**
* 查询zichan信息
*/
@RequestMapping(value="/selectall")
public String selectall(Integer id,Map<String,Object> map,HttpServletRequest request){
List<Map<String,Object>> list= new ArrayList<Map<String,Object>>();
Map<String,Object> map1= new HashMap<String,Object>();
String zcid=(String)request.getParameter("zcid");//资产编号
if(zcid!=null&&!zcid.equals("")){
map1.put("zcid",zcid);//资产编号
}
String zcmc=(String)request.getParameter("zcmc");//资产名称
if(zcmc!=null&&!zcmc.equals("")){
map1.put("zcmc",zcmc);//资产名称
}
String js=(String)request.getParameter("js");//介绍
if(js!=null&&!js.equals("")){
map1.put("js",js);//介绍
}
String grrq=(String)request.getParameter("grrq");//购入日期
if(grrq!=null&&!grrq.equals("")){
map1.put("grrq",grrq);//购入日期
}
String lb=(String)request.getParameter("lb");//类别
if(lb!=null&&!lb.equals("")){
map1.put("lb",lb);//类别
}
String jz=(String)request.getParameter("jz");//价值
if(jz!=null&&!jz.equals("")){
map1.put("jz",jz);//价值
}
String sl=(String)request.getParameter("sl");//数量
if(sl!=null&&!sl.equals("")){
map1.put("sl",sl);//数量
}
String bm=(String)request.getParameter("bm");//部门
if(bm!=null&&!bm.equals("")){
map1.put("bm",bm);//部门
}
String px=(String)request.getParameter("px");//部门
if(px!=null&&!px.equals("")){
map1.put("px",px);//排序
}
list=zichandao.selectAll(map1);
System.out.println("listsize="+list.size
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
一、源码特点 java ssm资产管理系统是一套完善的web设计系统(系统采用SSM框架进行设计开发,spring+springMVC+mybatis),对理解JSP java编程开发语言有帮助,系统具有完整的源代码和数据库,系统主要采用B/S模式开发。开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为Mysql5.0,使用java语言开发。 二、功能介绍 如博客中介绍 三、注意事项 1、管理员账号:admin 密码:admin 数据库配置文件datasource.properties 2、开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为Mysql5.0,使用java语言开发。 3、数据库文件名是jspssmzcgl.sql,系统名称ssmzcgl 4、系统首页地址:http://127.0.0.1:8080/ssmzcgl/login.jsp 不包含人工服务,如果需要调试,联系作者购买
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
共 651 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/3c425d273e46473cb9b19a74e6896a25_qq_41221322.jpg!1)
qq_251836457
- 粉丝: 4983
- 资源: 607
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)