基于javaweb+jsp的服装店门店信息管理系统

基于javaweb+jsp的服装店门店信息管理系统,第1张

基于javaweb+jsp的服装店门店信息管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

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

        request.getSession().setAttribute("vo", vo);
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("xiaoshou_" + to + ".jsp");
    }

    /**
     * 根据条件查询销售的列表并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("xiaoshouList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
            <result column="user_type" property="userType" />
    resultMap>

    <sql id="Base_Column_List">
        `id`,`username`,`password`,`real_name`,`user_sex`,`user_phone`,`user_text`,`user_type`
    sql>

    
    <insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.User">
        INSERT INTO `t_user`
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>`id`,if>
                    <if test ='username != null'>`username`,if>
                    <if test ='password != null'>`password`,if>
                    <if test ='realName != null'>`real_name`,if>
                    <if test ='userSex != null'>`user_sex`,if>
                    <if test ='userPhone != null'>`user_phone`,if>
                    <if test ='userText != null'>`user_text`,if>
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping
public class KuchunController {

    @Autowired
    private KuchunService kuchunService;

    /**
     * 增加库存
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("kuchunAdd")
    public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Kuchun vo = new Kuchun();
        //取出页面传进来的参数
        vo.setKuchunName(Util.decode(request, "kuchunName"));
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        Map<String, Object> map = xiaoshouService.list(params);
        request.getSession().setAttribute("list", map.get("list"));
        kuchunService.update(vo);
        this.redirectList(request, response);
    }

    /**
     * 获取库存的详细信息(详情页面与编辑页面要显示该库存的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping({"kuchunGet", "kuchunEditPre"})
    public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");//取出主键id
        Kuchun vo = kuchunService.get(id);
        request.getSession().setAttribute("vo", vo);
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("kuchun_" + to + ".jsp");
    }

    /**
     * 根据条件查询库存的列表并跳转回页面
     *
     * @param response
     * @param request
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        Map<String, Object> map = goodService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = Util.decode(request, "pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", pb.getPageSize());
        List list = (List) goodService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        pb.setServlet("goodList");
        pb.setSearchColumn(searchColumn);
        pb.setKeyword(keyword);
        pb.setList(list);
        request.getSession().setAttribute("pageBean", pb);
        request.getSession().setAttribute("list", pb.getList());

        response.sendRedirect("good_list.jsp");
    }
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        Map<String, Object> map = supplierService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = Util.decode(request, "pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", pb.getPageSize());
        List list = (List) supplierService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
        pb.setServlet("supplierList");
        pb.setSearchColumn(searchColumn);
                div>
            div>
            <div class="form-group">
                <label class="col-sm-3 control-label">价格:label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="kuchunJiage" name="kuchunJiage" value="${vo.kuchunJiage}">
                div>
            div>
            <div class="form-group">
                <label class="col-sm-3 control-label">入库时间:label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="kuchunShijiana" name="kuchunShijiana" value="${vo.kuchunShijiana}">
                div>
            div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品描述:label>
            <div class="col-sm-5">
                <textarea rows="3" class="form-control" id="kuchunText" name="kuchunText" placeholder="请输入内容......">${vo.kuchunText}textarea>
            div>
        div>
        <div class="form-group">
            <label class="col-sm-3 control-label">label>
            <div class="col-sm-5">
                <input type="submit" class="btn btn-line btn-rect btn-info btn-sm" value="保存">
                <input type="button" class="btn btn-line btn-rect btn-default btn-sm" value="返回" onclick="javascript:history.back(-1);">
            div>
        }
        if (document.getElementById("jinghuoPrice").value.trim().length == 0) {
            alert("金额不能为空!");
            return false;
        }
        if (document.getElementById("jinghuoSulinag").value.trim().length == 0) {
            alert("数量不能为空!");
            return false;
        }
        if (document.getElementById("jinghuoShijian").value.trim().length == 0) {
            alert("进货时间不能为空!");
            return false;
        }
        return true;
    }
script>
html>

DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.demo.dao.JinghuoMapper">


运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

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

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

适用

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

功能说明

登录、注册、退出、用户模块、公告模块、供应商模块、商品模块、进货模块、库存盘点、销售模块的增删改查管理

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/725681.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-26
下一篇 2022-04-26

发表评论

登录后才能评论

评论列表(0条)

保存