Java ʵս��Ŀ֮���ߵ��ϵͳ��ʵ������

һ����Ŀ����

���ܰ����� ǰ̨ʵ�֣��û�����˵�����Ʒ����ɸѡ���鿴�˵��� �顢��ӹ��ﳵ�����ﳵ���㡢��Աȯ�����˶�����ѯ�� �ȡ� ��̨ʵ�֣���ϵ�������Ʒ��������������ϵͳ����� �ϼ���Ա����ȡ� ϵͳ��Ϊ���߻����Ա���˿͡���ʦ������Ա�ȵȡ�

������Ŀ����

�������ã� Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts ��֧��)

��Ŀ������ JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven�ȵȡ�

��̨�û���Ϣ���Ʋ㣺

@RestController
@RequestMapping("/backstage/user")
public class UserManageController {
 
    @Autowired
    private UserService userService;
 
    /**
     * ����ҳ������������û��б�
     * @param vo
     * @return
     */
    @RequestMapping("/list")
    public String findUserListByPage(UserVo vo){
        LayuiTableDataResult userListByPage = userService.findUserListByPage(vo);
        return JSON.toJSONString(userListByPage);
    }
 
    /**
     * ��̨����û�
     * @param vo
     * @return
     */
    @RequestMapping("/add")
    public String addUser(UserVo vo){
        Map<String, Object> map = userService.addUser(vo);
        return JSON.toJSONString(map);
    }
 
    /**
     * ��̨�޸��û���Ϣ
     * @param vo
     * @return
     */
    @RequestMapping("/modify")
    public String modifyUserBackstage(UserVo vo){
        Map<String, Object> map = userService.modifyUserBackstage(vo);
        return JSON.toJSONString(map);
    }
 
    /**
     * �����û�����
     * @param userId
     * @return
     */
    @RequestMapping("/resetPassword")
    public String resetPassword(Long userId){
        Map<String, Object> map = userService.resetPassword(userId);
        return JSON.toJSONString(map);
    }
 
    /**
     * ���Ҹ��û���ӵ�еĽ�ɫ
     * @param userId
     * @return
     */
    @RequestMapping("/findRole")
    public String findRoleListByUserId(Long userId){
        LayuiTableDataResult roleListByUserId = userService.findRoleListByUserId(userId);
        return JSON.toJSONString(roleListByUserId);
    }
 
    /**
     * Ϊ�û���Ȩ��ɫ
     * @param roleIds
     * @param userId
     * @return
     */
    @RequestMapping("/grantRole")
    public String grantRole(String roleIds, Long userId){
        Map<String, Object> map = userService.grantRole(roleIds, userId);
        return JSON.toJSONString(map);
    }
 
    /**
     * ɾ���û���Ϣ
     * @param userId
     * @return
     */
    @RequestMapping("/delete")
    public String deleteUser(Long userId){
        Map<String, Object> map = userService.deleteUser(userId);
        return JSON.toJSONString(map);
    }
}

�û���ַ�����������

/**
 * �û���ַ���������
 */
@RestController
@RequestMapping("/address")
public class AddressController {
 
    @Autowired
    private AddressService addressService;
 
    /**
     * ���Ҹý�ɫ�����е�ַ��Ϣ������LayUI���ݱ���ʽ
     */
    @RequestMapping("/list")
    public String findAddressListByUserId(AddressVo vo, HttpSession session){
        vo.setUserId(((UserEntity) session.getAttribute("userLogin")).getUserId());
        LayuiTableDataResult addressListByUserId = addressService.findAddressListByUserId(vo);
        return JSON.toJSONString(addressListByUserId);
    }
 
    /**
     * ���Ҹý�ɫ�����е�ַ��Ϣ������Map��ʽ
     * @param session
     * @return
     */
    @RequestMapping("/listByUser")
    public String findAddressListByUser(HttpSession session){
        Map<String, Object> map = addressService.findAddressListByUser(session);
        return JSON.toJSONString(map);
    }
 
    /**
     * ��ӵ�ַ
     * @param vo
     * @return
     */
    @RequestMapping("/add")
    public String addAddress(AddressVo vo, HttpSession session){
        Map<String, Object> map = addressService.addAddress(vo, session);
        return JSON.toJSONString(map);
    }
 
    /**
     * �޸ĵ�ַ
     * @param vo
     * @return
     */
    @RequestMapping("/modify")
    public String modifyAddress(AddressVo vo, HttpSession session){
        Map<String, Object> map = addressService.modifyAddress(vo, session);
        return JSON.toJSONString(map);
    }
 
    /**
     * ɾ����ַ
     * @param addressId
     * @return
     */
    @RequestMapping("/delete")
    public String deleteAddress(Long addressId){
        Map<String, Object> map = addressService.deleteAddress(addressId);
        return JSON.toJSONString(map);
    }
}

ǰ̨�û���Ϣ���Ʋ㣺

@Controller
@RequestMapping("/user")
public class UserController {
 
    @Autowired
    private UserService userService;
 
    /**
     * �û���¼
     * @param username
     * @param password
     * @param session
     * @return
     */
    @ResponseBody
    @RequestMapping("/login")
    public String login(String username, String password, HttpSession session){
        Map<String, Object> map = userService.login(username, password, session);
        return JSON.toJSONString(map);
    }
 
    /**
     * �˳���¼
     * @param session
     * @return
     */
    @RequestMapping("/exit")
    public String exit(HttpSession session){
        userService.exit(session);
        return "redirect:/login.html";
    }
 
    /**
     * У���û�ע��������û����Ƿ����
     * @param username
     * @return
     */
    @ResponseBody
    @RequestMapping("/checkUsername")
    public String checkUsername(String username){
        Map<String, Object> map = userService.checkUsername(username);
        return JSON.toJSONString(map);
    }
 
    /**
     * �û�ע��
     * @param vo
     * @param session
     * @return
     */
    @ResponseBody
    @RequestMapping("/register")
    public String register(UserVo vo, HttpSession session){
        Map<String, Object> register = userService.register(vo, session);
        return JSON.toJSONString(register);
    }
 
    /**
     * ��ѯ��¼�û��ĸ�������
     * @param session
     * @return
     */
    @ResponseBody
    @RequestMapping("/findUserByUserId")
    public String findUserByUserId(HttpSession session){
        Long userId = ((UserEntity) session.getAttribute(SystemConstant.USERLOGIN)).getUserId();
        Map<String, Object> userByUserId = userService.findUserByUserId(userId);
        return JSON.toJSONString(userByUserId);
    }
 
    /**
     * ��ѯij���û��ĸ�������
     * @param vo
     * @return
     */
    @ResponseBody
    @RequestMapping("/modifyUserInfo")
    public String modifyUserInfo(UserVo vo, HttpSession session){
        Map<String, Object> map = userService.modifyUserReception(vo, session);
        return JSON.toJSONString(map);
    }
 
    /**
     * �û��޸�����
     * @param oldPassword
     * @param newPassword
     * @param session
     * @return
     */
    @ResponseBody
    @RequestMapping("/modifyPassword")
    public String modifyPassword(String oldPassword, String newPassword, HttpSession session){
        Map<String, Object> map = userService.modifyPassword(oldPassword, newPassword, session);
        return JSON.toJSONString(map);
    }
}

�Ż�ȯ�̳ǿ�������

/**
 * �Ż�ȯ�̳ǿ�����
 */
@RestController
@RequestMapping("/reception/ticket")
public class TicketController {
 
    @Autowired
    private TicketService ticketService;
 
    /**
     * ��ѯ�����ϼܵ��Ż�ȯ���
     * @return
     */
    @RequestMapping("/findAll")
    public String findAllTicketOnShelf(){
        Map<String, Object> map = ticketService.findAllTicketOnShelf();
        return JSON.toJSONString(map);
    }
 
    /**
     * ��ȡ�Ż�ȯ
     * @param ticketTypeId
     * @param session
     * @return
     */
    @RequestMapping("/receiveTicket")
    public String receiveTicket(Long ticketTypeId, HttpSession session){
        Map<String, Object> map = ticketService.receiveTicket(ticketTypeId, session);
        return JSON.toJSONString(map);
    }
 
    /**
     * ��ѯij���û����Ż�ȯ��¼
     * @param session
     * @return
     */
    @RequestMapping("/findByUser")
    public String findByUser(HttpSession session){
        Map<String, Object> map = ticketService.findByUser(session);
        return JSON.toJSONString(map);
    }
 
    /**
     * ��ѯ���û�δʹ�õ��Ż�ȯ
     * @param session
     * @return
     */
    @RequestMapping("/findByUserUnuse")
    public String findByUserUnuse(HttpSession session){
        Map<String, Object> map = ticketService.findByUserUnuse(session);
        return JSON.toJSONString(map);
    }
 
    /**
     * �����Ż�ȯ��Ų�ѯ�Ż�ȯ
     * @param ticketId
     * @return
     */
    @RequestMapping("/findTicketById")
    public String findTicketById(Long ticketId){
        Map<String, Object> map = ticketService.findTicketById(ticketId);
        return JSON.toJSONString(map);
    }
 
}

���ﳵ��������

/**
 * ���ﳵ������
 */
@RestController
@RequestMapping("/reception/shopcart")
public class ShopcartController {
 
    @Autowired
    private ShopcartService shopcartService;
 
    /**
     * ��Ӳ�ƷSKU�����ﳵ
     * @param session
     * @param numCount
     * @param skuId
     * @return
     */
    @RequestMapping("/add")
    public String addShopcart(Long skuId, Integer numCount, HttpSession session){
        Map<String, Object> map = shopcartService.addShopcart(skuId, numCount, session);
        return JSON.toJSONString(map);
    }
 
    /**
     * ���Ҹ��û��µ����й��ﳵ��Ϣ
     * @param session
     * @return
     */
    @RequestMapping("/findByUserId")
    public String findAllShopcartByUserId(HttpSession session){
        Map<String, Object> map = shopcartService.findAllShopcartByUserId(session);
        return JSON.toJSONString(map);
    }
 
    /**
     * �������û�ij��SKU��Ʒ������
     * @param shopcartId
     * @return
     */
    @RequestMapping("/addNumCountOne")
    public String addNumCountOne(Long shopcartId){
        Map<String, Object> map = shopcartService.addNumCountOne(shopcartId);
        return JSON.toJSONString(map);
    }
 
    /**
     * ���ٸ��û�ij��SKU��Ʒ������
     * @param shopcartId
     * @return
     */
    @RequestMapping("/reduceNumCountOne")
    public String reduceNumCountOne(Long shopcartId){
        Map<String, Object> map = shopcartService.reduceNumCountOne(shopcartId);
        return JSON.toJSONString(map);
    }
 
    /**
     * ɾ�����ﳵ��ijһ����Ŀ
     * @param shopcartId
     * @return
     */
    @RequestMapping("/delete")
    public String deleteShopcart(Long shopcartId){
        Map<String, Object> map = shopcartService.deleteShopcart(shopcartId);
        return JSON.toJSONString(map);
    }
 
}

������ƪ����Java ʵս��Ŀ֮���ߵ��ϵͳ��ʵ�����̵����¾ͽ��ܵ�����,�������Java ���ߵ��ϵͳ�����������ű�֮����ǰ�����»�������������������ϣ������Ժ���֧�ֽű�֮�ң�

推薦閱讀: