Bootstrap

基于javaweb+mysql的ssm药品进货销售管理系统(java+ssm+js+jsp+mysql)

基于javaweb+mysql的ssm药品进货销售管理系统(java+ssm+js+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb+mysql的SSM药品进货销售管理系统(java+ssm+js+jsp+mysql)

项目介绍

管理员角色包含以下功能: 管理员登录,角色权限管理,职工管理,药品销售管理,供应商管理,进货管理,药品信息管理,过期药品处理等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
		public int getStatus() {
			return status;
		}
		public void setStatus(int status) {
			this.status = status;
		}
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		
    

}
/*

 * 

 * 修改历史 : 
 */

/**!
 * //TODO 添加类/接口功能描述

public class Yaopininfo {
	public int id;
	public String name;
	public String changjia;
	public String leibie;
	public String danwei;
	public String jhdanjia;
	public String lsdanjia;
	public int status;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getChangjia() {
		return changjia;
	}
	public void setChangjia(String changjia) {
		this.changjia = changjia;
	}
	
	public String getLeibie() {
		return leibie;
	}
	public void setLeibie(String leibie) {
		this.leibie = leibie;
	}
	public String getDanwei() {
		return danwei;
	}
	public void setDanwei(String danwei) {
		this.danwei = danwei;
	}
	
	public String getJhdanjia() {
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
          <ul class="sidebar-list">
                <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>常用操作</a>
                    <ul class="sub-menu">
                         <s:iterator value="#session.caidan" var="cd" status="st">
                            <s:if test="#cd.caidan=='系统用户管理'"><li><a href="user/userManagerAction!searchUser?page.newpage=1"><i class="icon-font">&#xe008;</i>系统用户管理</a></li></s:if>
                            <s:if test="#cd.caidan=='角色权限管理'"><li><a href="user/userManagerAction!searchJuese?page.newpage=1"><i class="icon-font">&#xe008;</i>角色权限管理</a></li></s:if>
                            <s:if test="#cd.caidan=='职工管理'"><li><a href="zhigong/zhigongAction!searchZhigong?page.newpage=1&page.keyword="><i class="icon-font">&#xe012;</i>职工管理</a></li></s:if>
                         </s:iterator>
                    </ul>
                </li>
                <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>药品销售管理</a>
                    <ul class="sub-menu">
                    <s:iterator value="#session.caidan" var="cd" status="st">
                        <s:if test="#cd.caidan=='销售'"><li><a href="yaopin/yaopinAction!xiaoshou"><i class="icon-font">&#xe017;</i>销售</a></li></s:if>
                        <s:if test="#cd.caidan=='价目表管理'"><li><a href="yaopin/yaopinAction!yaopinjiamu?page.newpage=1&page.keyword="><i class="icon-font">&#xe037;</i>价目表管理</a></li></s:if>
                        <s:if test="#cd.caidan=='销售单查询'"><li><a href="yaopin/yaopinAction!xiaoshoudan?page.newpage=1&page.keyword="><i class="icon-font">&#xe046;</i>销售单查询</a></li></s:if>
                    </s:iterator>
                    </ul>
                </li>
                <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>药品进货管理</a>
                    <ul class="sub-menu">
                    <s:iterator value="#session.caidan" var="cd" status="st">
                        <s:if test="#cd.caidan=='供应商信息管理'"><li><a href="gongyingshang/gongyingshangAction!searchGYS?page.newpage=1&page.keyword="><i class="icon-font">&#xe017;</i>供应商信息管理</a></li></s:if>
                        <s:if test="#cd.caidan=='进货'"><li><a href="yaopin/yaopinAction!jinhuo"><i class="icon-font">&#xe037;</i>进货</a></li></s:if>
                        <s:if test="#cd.caidan=='进货单信息查询'"><li><a href="yaopin/yaopinAction!jinhuodan?page.newpage=1&page.keyword="><i class="icon-font">&#xe046;</i>进货单信息查询</a></li></s:if>
                        <s:if test="#cd.caidan=='药品信息管理'"><li><a href="yaopin/yaopinAction!yaopininfo?page.newpage=1&page.keyword="><i class="icon-font">&#xe045;</i>药品信息管理</a></li></s:if>
                    </s:iterator>
                    </ul>
                </li>
                 <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>过期药品处理</a>
                    <ul class="sub-menu">
                    <s:iterator value="#session.caidan" var="cd" status="st">
                         <s:if test="#cd.caidan=='过期/毁坏处理'"><li><a href="yaopin/yaopinAction!guoqichuli"><i class="icon-font">&#xe017;</i>过期/毁坏处理</a></li></s:if>
                    </s:iterator>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">
    		state = "";
    	}
    	yaopininfo = null;
    	return "yaopininfo";
    }
    //删除药品信息
    public String delinfo(){
    	int i = yaopinservice.delinfo(yaopininfo);
    	page.setListnum(yaopinservice.yaopininfoListnum(page));
    	page=pageInfo(page);
    	yaopininfoList = yaopinservice.searchYaopinInfo(page);
    	if(i>0){
    		state = "删除成功";
    	}
    	else{
    		state = "";
    	}
    	yaopininfo = null;
    	return "yaopininfo";
    }
    
    public String updateInfo(){
    	int i = yaopinservice.updateInfo(yaopininfo);
    	if(i>0){
    		state="success";
    	}
    	else{
    		state=null;
    	}
    	yaopininfo = null;
    	return "updateInfo";
    }
    public String xiaoshou(){
    	state = "";
    	page=null;
    	yaopininfoList = yaopinservice.searchYaopinInfo(page);
    	return "xiaoshou";
    }
    public String addXiaoshou(){
    	Date date=new Date();
		DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String time=format.format(date);
		xiaoshou.setDate(time);
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%">编号</th>
                            <th>用户名</th>
                            <th>电话</th>
                            <th>真实姓名</th>
                            <th>电子邮箱</th>
                            <th>用户状态</th>
                            <th>用户类型</th>
                            <th>重置密码</th>
                            <th>禁用/解禁</th>
                        </tr>
                        <s:iterator value="userList" var="us" status="st">
                        <tr>
                            <td class="tc">${(page.currpage-1)*page.pagelistnum+st.index+1}
                            <input name="id" value="${us.id}" type="hidden">
                            </td>
                            <td>
                                ${us.username}
                            </td>
                            <td>${us.phone}</td>
                            <td>${us.realname}</td>
                            <td>${us.email}</td>
                            <td><s:if test="#us.status==0"><font color="green">正常使用中</font></s:if> <s:if test="#us.status==1"><font color="red">禁用中</font></s:if></td>
                            <td class="type"><span>${us.type}</span>
                            <select id="${us.id}" class="se" style="display:none;">
                            <s:iterator value="jueseList" var="js" status="st">
                            <option value="${js.juese}" <s:if test="#js.juese == #us.type">selected = "selected"</s:if>>${js.juese}</option>
                            </s:iterator>
                            </select>
                            </td>
                            <td>
                            <a class="chongzhi" name="${us.id}"  href="">重置密码</a></td>
                            <td>
                            <s:if test="#us.status==0">
                            <a name="${us.id}"  href="user/userManagerAction!caozuo?user.id=${us.id}&user.status=${us.status}&page.keyword=${page.keyword}&page.newpage=${page.currpage }"><font color="red">禁用</font></a>
                            </s:if><s:if  test="#us.status==1">
                            <a name="${us.id}"  href="user/userManagerAction!caozuo?user.id=${us.id}&user.status=${us.status}&page.keyword=${page.keyword}&page.newpage=${page.currpage }"><font color="green">解禁</font></a>
                            </s:if></td>
                        </tr>
                        </s:iterator>
                    </table>
                    
                    <div class="list-page"> 共 ${page.listnum} 条结果 
                    <s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.newpage=1&page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}">首页</a></s:if> 
                    <s:if test="page.currpage == 1"><a ><font color="#aaaaaa">首页</font></a></s:if>
                    <s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.currpage-1}">上一页</a></s:if> 
                    <s:if test="page.currpage == 1"><a ><font color="#aaaaaa">上一页</font></a></s:if> 
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getGonghao() {
		return gonghao;
	}
	public void setGonghao(String gonghao) {
		this.gonghao = gonghao;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getBumen() {
		return bumen;
	}
	public void setBumen(String bumen) {
		this.bumen = bumen;
	}
	public String getZhiwu() {
		return zhiwu;
	}
	public void setZhiwu(String zhiwu) {
		this.zhiwu = zhiwu;
	}
	public String getBirthday() {
		return birthday;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getRuzhidate() {
		return ruzhidate;
	}
	public void setRuzhidate(String ruzhidate) {
		this.ruzhidate = ruzhidate;
	}
	public String getLizhidate() {
		return lizhidate;
	}
	public void setLizhidate(String lizhidate) {
		<result property="juese" column="juese" />
	</resultMap>
	<resultMap type="Caidan" id="resultCaidan">
		<id property="id" column="id" />
		<result property="juese" column="juese" />
		<result property="caidan" column="caidan" />
	</resultMap>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qdu.dao.zhigongDao">
	<select id="listnum" parameterType="Page" resultType="int">
	    select count(id) from zhigong 
	    <if test="keyword != null and keyword != ''">
	       where name = #{keyword}
	    </if>
	</select>
	<select id="zhigongList"  parameterType="Page" resultMap="resultZhigong">
	    select * from zhigong 
	    <if test="keyword != null and keyword != ''">
	        where name like CONCAT('%',#{keyword},'%') 
	    </if>
	     order by id desc limit #{startnum},#{pagelistnum}
	</select>
	<update id="lizhi" parameterType="Zhigong">
	    update zhigong set status=1,lizhidate=#{lizhidate} where id=#{id}
	</update>
	<insert id="addzhigong" parameterType="Zhigong">
	    insert into zhigong values(default,#{gonghao},#{name},#{bumen},#{zhiwu},#{birthday},#{sex},#{ruzhidate},null,0)
	</insert>
<update id="xiugai" parameterType="Zhigong">
	    update zhigong set 
	    <if test="gonghao!=null">
	       gonghao=#{gonghao} 
	    </if>
	    <if test="name!=null">
	       name=#{name} 
	    </if>
	    <if test="bumen!=null">
	       bumen=#{bumen} 
	    </if>
	    <if test="zhiwu!=null">
	       zhiwu=#{zhiwu} 
	    </if>
	    <if test="sex!=null">
	       sex=#{sex} 
	    </if>
	    <if test="birthday!=null">
	       birthday=#{birthday} 
	    </if>
	    <if test="ruzhidate!=null">
	       ruzhidate=#{ruzhidate} 
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qdu.dao.zhigongDao">
	<select id="listnum" parameterType="Page" resultType="int">
	    select count(id) from zhigong 
	    <if test="keyword != null and keyword != ''">
	       where name = #{keyword}
	    </if>
	</select>
	<select id="zhigongList"  parameterType="Page" resultMap="resultZhigong">
	    select * from zhigong 
	    <if test="keyword != null and keyword != ''">
	        where name like CONCAT('%',#{keyword},'%') 
	    </if>
	     order by id desc limit #{startnum},#{pagelistnum}
	</select>
	<update id="lizhi" parameterType="Zhigong">
	    update zhigong set status=1,lizhidate=#{lizhidate} where id=#{id}
	</update>
	<insert id="addzhigong" parameterType="Zhigong">
	    insert into zhigong values(default,#{gonghao},#{name},#{bumen},#{zhiwu},#{birthday},#{sex},#{ruzhidate},null,0)
	</insert>
<update id="xiugai" parameterType="Zhigong">
	    update zhigong set 
	    <if test="gonghao!=null">
	       gonghao=#{gonghao} 
	    </if>
	    <if test="name!=null">
	       name=#{name} 
	    </if>
	    <if test="bumen!=null">
	       bumen=#{bumen} 
	    </if>
	    <if test="zhiwu!=null">
	       zhiwu=#{zhiwu} 
	    </if>
	    <if test="sex!=null">
	       sex=#{sex} 
 */
public class zhigongServiceImpl implements zhigongService{
    public zhigongDao zhigongdao=null;
 
   
    public zhigongDao getZhigongdao() {
		return zhigongdao;
	}
    
	public void setZhigongdao(zhigongDao zhigongdao) {
		this.zhigongdao = zhigongdao;
	}
	public int listnum(Page page) {
		return zhigongdao.listnum(page);
	}
	public List<Zhigong> zhigongList(Page page) {
		return zhigongdao.zhigongList(page);
	}
	public int lizhi(Zhigong zhigong){
		return zhigongdao.lizhi(zhigong);
	}
	public int xiugai(Zhigong zhigong){
		return zhigongdao.xiugai(zhigong);
	}
	public int addzhigong(Zhigong zhigong){
		return zhigongdao.addzhigong(zhigong);
	}
    
}

public class Xiaoshou {
	public int id;
	public String yaopinid;
	public String yaopinname;
	public String shuliang;
	public String danjia;
	public String zongjia;
	public String date;
	public int status;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getYaopinid() {
		return yaopinid;
	}
	public void setYaopinid(String yaopinid) {
    	page=null;
    	yaopininfoList = yaopinservice.searchYaopinInfo(page);
    	gongyingshangList = yaopinservice.searchGongyingshang(page);
    	return "jinhuo";
    }
    public String addJinhuo(){
    	Date date=new Date();
		DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String time=format.format(date);
		jinhuo.setJinhuodate(time);
    	int i = yaopinservice.addJinhuo(jinhuo);
    	yaopinkucun = yaopinservice.searchKucun(jinhuo);
    	if(yaopinkucun==null){
    		int j = yaopinservice.addYaopinKucun(jinhuo);
    	}
    	else{
    		int j = yaopinservice.updateYaopinKucun(jinhuo);
    	}
    	yaopininfoList = yaopinservice.searchYaopinInfo(page);
    	gongyingshangList = yaopinservice.searchGongyingshang(page);
    	if(i>0){
    		state = "成功进货<br>药品名:"+jinhuo.getYaopinname()+"<br>数量:"+jinhuo.getShuliang()+"<br>总价:"+jinhuo.getZongjia();
    	}
    	else{
    		state = "";
    	}
    	return "jinhuo";
    }
    //进货时查找选中的药品信息并加到页面
    public String jinhuoxinxi(){
    	yaopininfo = yaopinservice.jinhuoxinxi(yaopininfo);
    	JSONArray json = JSONArray.fromObject(yaopininfo);
		state = json.toString();
    	return "jinhuoxinxi";
    }
    //进货单
    public String jinhuodan(){
    	state = "";
    	page.setListnum(yaopinservice.jinhuodanListnum(page));
    	page=pageInfo(page);
    	jinhuoList = yaopinservice.jinhuodan(page);
    	return "jinhuodan";
    }
    public String yaopininfo(){
    	state="";
				url : "user/userManagerAction!resetPass?user.id="+id,
				dataType : "json",
				async : false,
				success : function show(data) {
					but.html("<font color='#aaaaaa'>重置密码</font>");
					but.removeAttr("href");
					toastr.success("密码重置成功");
				}
			});
    		return false;
    	});
    	$(".type").dblclick(function() {
    		var span = $(this).children("span");
    		var text = $(this).children("span").html();
    		$(this).children("span").html("");
    		$(this).children("select").css("display","block");
    		$(this).children("select").change(function(){
    			var thisele = $(this);
    			$.ajax({
    				type : "POST",
    				url : "user/userManagerAction!editjuese?user.id="+$(this).attr("id")+"&user.type="+$(this).val(),
    				dataType : "json",
    				async : false,
    				success : function show(data) {
    					if(data=="success"){
    						thisele.parents("td").children("span").html(thisele.val());
    						thisele.css("display","none");
    						toastr.success("修改角色成功");
    					}
    					else{
    						thisele.parents("td").children("span").html(text);
    						thisele.css("display","none");
    						toastr.error("修改可能出现错误,请重试");
    					}
    				}
    			});
    		});
    	});
    	//点击设置管理员的操作
    	$(".admin").click(function(){
    		var id = $(this).attr("name");
    		var but = $(this);
    		$.ajax({
				type : "POST",
				url : "user/userManagerAction!resetPass?user.id="+id+"&user.realname=admin",
				dataType : "json",
				async : false,
				success : function show(data) {
					but.html("<font color='#aaaaaa'>设置管理员</font>");
    	yaopininfo = null;
    	return "xiugaijiamu";
    }
    public String xiaoshoudan(){
    	state = "";
    	page.setListnum(yaopinservice.xiaoshouListnum(page));
    	page=pageInfo(page);
    	xiaoshouList = yaopinservice.xiaoshoudan(page);
    	return "xiaoshoudan";
    }
    public String guoqichuli(){
    	state = "";
    	yaopinkucunList = yaopinservice.searchYaopinKucun();
    	return "guoqichuli";
    }
    public String chuli(){
    	Date date=new Date();
		DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String time=format.format(date);
		yaopinchuli.setDate(time);
		int i = yaopinservice.chuli(yaopinchuli);
		int j = yaopinservice.jian(yaopinchuli);
		if(i>0){
    		state = "处理成功";
    	}
    	else{
    		state = "";
    	}
		return "guoqichuli";
    }
  //页面的方法
    public Page pageInfo(Page page){
    	if(page.getNewpage()!=0){
			page.setCurrpage(page.getNewpage());
		}
    	if(page.getPagelistnum()==0){
    		page.setPagelistnum(10);
    	}
		page.setStartnum((page.getCurrpage()-1)*page.getPagelistnum());
		if(page.getListnum()%page.getPagelistnum()!=0){
			page.setPagenum(page.getListnum()/page.getPagelistnum()+1);
		}
		else{
			page.setPagenum(page.getListnum()/page.getPagelistnum());
		}
		return page;
    }
    
	public Gongyingshang getGongyingshang() {
		return gongyingshang;
                            </td>
                            <td>
                                ${us.username}
                            </td>
                            <td>${us.phone}</td>
                            <td>${us.realname}</td>
                            <td>${us.email}</td>
                            <td><s:if test="#us.status==0"><font color="green">正常使用中</font></s:if> <s:if test="#us.status==1"><font color="red">禁用中</font></s:if></td>
                            <td class="type"><span>${us.type}</span>
                            <select id="${us.id}" class="se" style="display:none;">
                            <s:iterator value="jueseList" var="js" status="st">
                            <option value="${js.juese}" <s:if test="#js.juese == #us.type">selected = "selected"</s:if>>${js.juese}</option>
                            </s:iterator>
                            </select>
                            </td>
                            <td>
                            <a class="chongzhi" name="${us.id}"  href="">重置密码</a></td>
                            <td>
                            <s:if test="#us.status==0">
                            <a name="${us.id}"  href="user/userManagerAction!caozuo?user.id=${us.id}&user.status=${us.status}&page.keyword=${page.keyword}&page.newpage=${page.currpage }"><font color="red">禁用</font></a>
                            </s:if><s:if  test="#us.status==1">
                            <a name="${us.id}"  href="user/userManagerAction!caozuo?user.id=${us.id}&user.status=${us.status}&page.keyword=${page.keyword}&page.newpage=${page.currpage }"><font color="green">解禁</font></a>
                            </s:if></td>
                        </tr>
                        </s:iterator>
                    </table>
                    
                    <div class="list-page"> 共 ${page.listnum} 条结果 
                    <s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.newpage=1&page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}">首页</a></s:if> 
                    <s:if test="page.currpage == 1"><a ><font color="#aaaaaa">首页</font></a></s:if>
                    <s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.currpage-1}">上一页</a></s:if> 
                    <s:if test="page.currpage == 1"><a ><font color="#aaaaaa">上一页</font></a></s:if> 
                    <s:if test="page.currpage != page.pagenum"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.currpage+1}">下一页</a></s:if>
                    <s:if test="page.currpage == page.pagenum"><a><font color="#aaaaaa">下一页</font></a></s:if>
                    <s:if test="page.currpage != page.pagenum"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.pagenum}">末页</a></s:if>
                    <s:if test="page.currpage == page.pagenum"><a><font color="#aaaaaa">末页</font></a></s:if>
                   第 ${page.currpage} 页/共 <font id="pagenum">${page.pagenum }</font><a id="pagelianjie" href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}" style="float: right;">跳转</a><input id="tiaopage" style="float: right;" type="text">
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="index.jsp" class="navbar-brand">后台管理</a></h1>
            <ul class="navbar-list clearfix">
                <li><a class="on" href="index.jsp">首页</a></li>
                
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
              
            </ul>
        </div>
    </div>
</div>
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-title">
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
            <ul class="sidebar-list">
                <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>常用操作</a>
                    <ul class="sub-menu">
                         <s:iterator value="#session.caidan" var="cd" status="st">
                            <s:if test="#cd.caidan=='系统用户管理'"><li><a href="user/userManagerAction!searchUser?page.newpage=1"><i class="icon-font">&#xe008;</i>系统用户管理</a></li></s:if>
                            <s:if test="#cd.caidan=='角色权限管理'"><li><a href="user/userManagerAction!searchJuese?page.newpage=1"><i class="icon-font">&#xe008;</i>角色权限管理</a></li></s:if>
                            <s:if test="#cd.caidan=='职工管理'"><li><a href="zhigong/zhigongAction!searchZhigong?page.newpage=1&page.keyword="><i class="icon-font">&#xe012;</i>职工管理</a></li></s:if>
                         </s:iterator>
                    </ul>
                </li>
                <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>药品销售管理</a>
                    <ul class="sub-menu">
                    <s:iterator value="#session.caidan" var="cd" status="st">
                        <s:if test="#cd.caidan=='销售'"><li><a href="yaopin/yaopinAction!xiaoshou"><i class="icon-font">&#xe017;</i>销售</a></li></s:if>
                        <s:if test="#cd.caidan=='价目表管理'"><li><a href="yaopin/yaopinAction!yaopinjiamu?page.newpage=1&page.keyword="><i class="icon-font">&#xe037;</i>价目表管理</a></li></s:if>
                        <s:if test="#cd.caidan=='销售单查询'"><li><a href="yaopin/yaopinAction!xiaoshoudan?page.newpage=1&page.keyword="><i class="icon-font">&#xe046;</i>销售单查询</a></li></s:if>
                    </s:iterator>
                    </ul>
                </li>
                <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>药品进货管理</a>
                    <ul class="sub-menu">
                    <s:iterator value="#session.caidan" var="cd" status="st">
                        <s:if test="#cd.caidan=='供应商信息管理'"><li><a href="gongyingshang/gongyingshangAction!searchGYS?page.newpage=1&page.keyword="><i class="icon-font">&#xe017;</i>供应商信息管理</a></li></s:if>
    		state = "";
    	}
		return "guoqichuli";
    }
  //页面的方法
    public Page pageInfo(Page page){
    	if(page.getNewpage()!=0){
			page.setCurrpage(page.getNewpage());
		}
    	if(page.getPagelistnum()==0){
    		page.setPagelistnum(10);
    	}
		page.setStartnum((page.getCurrpage()-1)*page.getPagelistnum());
		if(page.getListnum()%page.getPagelistnum()!=0){
			page.setPagenum(page.getListnum()/page.getPagelistnum()+1);
		}
		else{
			page.setPagenum(page.getListnum()/page.getPagelistnum());
		}
		return page;
    }
    
	public Gongyingshang getGongyingshang() {
		return gongyingshang;
	}
	public void setGongyingshang(Gongyingshang gongyingshang) {
		this.gongyingshang = gongyingshang;
	}
	public List<Gongyingshang> getGongyingshangList() {
		return gongyingshangList;
	}
	public void setGongyingshangList(List<Gongyingshang> gongyingshangList) {
		this.gongyingshangList = gongyingshangList;
	}
	public yaopinService getYaopinservice() {
		return yaopinservice;
	}
	public void setYaopinservice(yaopinService yaopinservice) {
		this.yaopinservice = yaopinservice;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public Page getPage() {
		return page;
	}
	public void setPage(Page page) {
    select * from yaopininfo where 1=1
	    <if test="keyword != null and keyword != ''">
	        and name like CONCAT('%',#{keyword},'%') 
	    </if>
	    and status=0 order by id desc 
	    <if test="startnum != null and startnum != ''">
	        limit #{startnum},#{pagelistnum}
	    </if>
</select>
<select id="searchGongyingshang" resultMap="resultGYS">
    select * from gongyingshang where status=0  order by id desc 
</select>
<insert id="addJinhuo" parameterType="Jinhuo">
    insert into jinhuo values(default,#{yaopinid},#{yaopinname},#{jinhuodate},#{gongyingshang},#{pici},#{shengchandate},#{guoqidate},#{shuliang},#{danwei},#{danjia},#{zongjia},0)
</insert>
<select id="searchKucun" parameterType="Jinhuo" resultType="Yaopinkucun">
    select * from yaopinkucun where yaopinname=#{yaopinname}
</select>
<insert id="addYaopinKucun" parameterType="Jinhuo">
    insert into yaopinkucun values(default,null,#{yaopinname},#{shuliang},null,null,0)
</insert>
<update id="updateYaopinKucun"  parameterType="Jinhuo">
    update yaopinkucun set shuliang=shuliang+#{shuliang} where yaopinname=#{yaopinname}
</update>
<select id="jinhuoxinxi" parameterType="Yaopininfo" resultType="Yaopininfo">
    select * from yaopininfo where name=#{name}
</select>
<select id="jinhuodanListnum" parameterType="Page" resultType="int">
     select count(id) from jinhuo where 1=1
	    <if test="keyword != null and keyword != ''">
	         and yaopinname like CONCAT('%',#{keyword},'%') 
	    </if>
	     and status=0
</select>
<select id="yaopininfoListnum" parameterType="Page" resultType="int">
     select count(id) from yaopininfo where 1=1
	    <if test="keyword != null and keyword != ''">
	         and name like CONCAT('%',#{keyword},'%') 
	    </if>
	     and status=0
</select>
<select id="jinhuodan"  parameterType="Page" resultMap="resultJinhuo">
	    select * from jinhuo where 1=1
	    <if test="keyword != null and keyword != ''">
	        and yaopinname like CONCAT('%',#{keyword},'%') 
	    </if>
	    and status=0 order by id desc limit #{startnum},#{pagelistnum}
</select>
<insert id="addyaopininfo" parameterType="Yaopininfo">
	    insert into yaopininfo values(default,#{name},#{changjia},#{leibie},#{danwei},null,null,0)
</insert>
	public void setYaopinchuli(Yaopinchuli yaopinchuli) {
		this.yaopinchuli = yaopinchuli;
	}
	public Yaopinkucun getYaopinkucun() {
		return yaopinkucun;
	}
	public void setYaopinkucun(Yaopinkucun yaopinkucun) {
		this.yaopinkucun = yaopinkucun;
	}
	public List<Yaopinchuli> getYaopinchuliList() {
		return yaopinchuliList;
	}
	public void setYaopinchuliList(List<Yaopinchuli> yaopinchuliList) {
		this.yaopinchuliList = yaopinchuliList;
	}
	public List<Yaopinkucun> getYaopinkucunList() {
		return yaopinkucunList;
	}
	public void setYaopinkucunList(List<Yaopinkucun> yaopinkucunList) {
		this.yaopinkucunList = yaopinkucunList;
	}
	public List<Yaopininfo> getYaopininfoList() {
		return yaopininfoList;
	}
	public void setYaopininfoList(List<Yaopininfo> yaopininfoList) {
		this.yaopininfoList = yaopininfoList;
	}
    
    

}
/*

 * 

 * 修改历史 : 
 */

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

;