栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SSM框架实战之超市账单管理系统

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SSM框架实战之超市账单管理系统

        根据所学知识以及材料模板,开发了基于SSM框架的超市账单管理系统,其中涉及到了各个模块的增删改查以及导出数据功能,初学者可以拿来练练手,部分代码如下,喜欢的小伙伴可以在关赞收后可以找我要源码噢!

@Controller
public class TbbillController {
    
    @Autowired
    private TbbillService tbbillService;
    
    @Autowired
    private TbproviderService tbproviderService;
    

   @RequestMapping("addBill")
    public String addBill(Tbbill bill) {
        
        tbbillService.insert(bill);
        return "redirect:findBillByPage.action";
    }


    @RequestMapping("findBillByPage")
    public String findBillByPage(String uname, Integer ispay, Integer nowPage, Model model) {

        if (nowPage == null) {
            nowPage = 1;
        }

        PageService page = new PageService();
        page.setGoodsname(uname);
        page.setIspay(ispay);
        page.setNowPage(nowPage);
        
        System.out.println("总记录数:"+tbbillService.getBillCount(page));
        
        //  总记录数 算出总页数 getCount(*)
        page.setTotal(tbbillService.getBillCount(page));
        
        List list = tbbillService.findBillByPage(page);
        model.addAttribute("list", list);
        
        //分页的信息传递到前端页面
        model.addAttribute("nowPage", page.getNowPage());
        model.addAttribute("pageCount", page.getPageCount());
        model.addAttribute("total", page.getTotal());
        model.addAttribute("pageSize", page.getPageSize());
        
        return "admin_bill_list.jsp";
    }
    
    @RequestMapping("deleteBillById")
    public String deleteBillById(Integer id) {
        tbbillService.deleteByPrimaryKey(id);
        return "redirect:findBillByPage.action";
    }
    
    //根据id获取账单信息
    @RequestMapping("findBillById")
    public String findBillById(Integer id,Model model) {
        Tbbill bill = tbbillService.selectByPrimaryKey(id);
        
        List list = tbproviderService.selectAll();
        model.addAttribute("proList", list);
        
        model.addAttribute("bill", bill);
        
        return "modify.jsp";
    }

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/274508.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号