• 大小: 2.62MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-11
  • 语言: Java
  • 标签: ssm整合  

资源简介

本项目考察ssm整合技术+bootstrap前台页面优化+echarts数据图表+常用前端插件+数据交易逻辑+jsp常用标签+mysql,以下截图和推荐实现步骤和方法,除特别要求外,仅供参考。

资源截图

代码片段和文件信息

package cn.campusshop.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.campusshop.pojo.Account;
import cn.campusshop.pojo.Customer;
import cn.campusshop.service.AccountService;
import cn.campusshop.service.CustomerService;
import cn.campusshop.utils.CampusResult;

@Controller
public class AccountController {
    @Autowired
    private AccountService accService;
    @Autowired
    private CustomerService cusService;
    static Logger logger = Logger.getLogger(AccountController.class);

    @RequestMapping(“showInfo“)
    @ResponseBody
    public CampusResult showInfo(Model model HttpSession httpSession) {
        CampusResult result = (CampusResult) httpSession.getAttribute(“Account“);
        return result;

    }

    @RequestMapping(“/login“)
    @ResponseBody
    public CampusResult loginCheck(@RequestBody HashMap hashmap Model model
            HttpSession httpSession) {
        String id = hashmap.get(“id“);
        Integer password = Integer.parseInt(hashmap.get(“password“));
        System.out.println(id);
        if (id == null || password == null) {
            CampusResult result = CampusResult.build(500 “用户名和密码不能为空“);
            model.addAttribute(“msg“ result);
            return result;
        }
        List list = accService.getAccountByAidOrCidAndPassword(id password);
        if (list == null || list.size() == 0) {
            CampusResult result = CampusResult.build(500 “用户名或密码不正确“);
            model.addAttribute(“msg“ result);
            return result;
        }
        String cid = list.get(0).getAcid();
        Customer customer = cusService.getCustomerByAcid(cid);
        // Listject>> listw = new ArrayListject>>();
        Mapject> map = new HashMap();
        map.put(“Customer“ customer);
        map.put(“Account“ list);
        // listw.add(map);
        // 把账户和用户信息存入集合
        if (list.size() == 1) {
            // 单账户
            httpSession.setAttribute(“Customer“ customer);
            httpSession.setAttribute(“loginSession“ list.get(0));
            CampusResult result = CampusResult.build(200 “单账户“ map);
            httpSession.setAttribute(“Account“ result);
            return result;
        } else {
            httpSession.setAttribute(“Customer“ customer);
            CampusResult result = CampusResult.build(200 “多账户“ map);
            model.addAttribute(“Account“ result);
            

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-12-30 10:39  onlinebank\
     文件        2225  2019-11-19 17:16  onlinebank\.classpath
     文件        1447  2019-08-05 13:25  onlinebank\.project
     目录           0  2019-08-12 10:44  onlinebank\.settings\
     文件         639  2019-08-05 00:20  onlinebank\.settings\.jsdtscope
     文件          69  2019-08-12 10:44  onlinebank\.settings\org.eclipse.jdt.apt.core.prefs
     文件         675  2019-08-12 10:44  onlinebank\.settings\org.eclipse.jdt.core.prefs
     文件          90  2019-08-05 00:20  onlinebank\.settings\org.eclipse.m2e.core.prefs
     文件         778  2019-10-22 17:07  onlinebank\.settings\org.eclipse.wst.common.component
     文件         321  2019-08-05 00:27  onlinebank\.settings\org.eclipse.wst.common.project.facet.core.prefs.xml
     文件         346  2019-08-05 00:27  onlinebank\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2019-08-05 00:20  onlinebank\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2019-08-05 00:20  onlinebank\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          50  2019-08-05 00:20  onlinebank\.settings\org.eclipse.wst.validation.prefs
     目录           0  2019-08-12 09:32  onlinebank\.svn\
     文件           3  2019-08-08 13:05  onlinebank\.svn\entries
     文件           3  2019-08-08 13:05  onlinebank\.svn\format
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\06\
     文件        1517  2019-08-08 13:05  onlinebank\.svn\pristine\06\06468cb0b5cc3dfae41b90f1ae119a8e6a1d049a.svn-base
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\0a\
     文件        7538  2019-08-08 13:06  onlinebank\.svn\pristine\0a\0a97bdd0e15fd657f952141c6500f7e529a93ebd.svn-base
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\0b\
     文件        1410  2019-08-08 13:06  onlinebank\.svn\pristine\0b\0be636325e4a962c4807ba6ddb6b42bbe456a28d.svn-base
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\0d\
     文件       93643  2019-08-08 13:05  onlinebank\.svn\pristine\0d\0d2c36140116e28fa3972a796234bfb1410ef649.svn-base
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\10\
     文件       10235  2019-08-08 13:06  onlinebank\.svn\pristine\10\10b715e59ee1fbf1c23d4efa71975202fa7638ce.svn-base
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\13\
     文件        3217  2019-08-08 13:06  onlinebank\.svn\pristine\13\13062568f8eefab3680e649cbc2ea468bee5d587.svn-base
     目录           0  2019-08-12 09:32  onlinebank\.svn\pristine\14\
............此处省略756个文件信息

评论

共有 条评论