资源简介

之前寒假写的一个小项目,idea写的,用了maven工程,Spring+SpringMVC+MyBatis框架技术实现校园超市系统。 有几个类似功能还没有实现,比如:只实现了系统用户的条件搜索查询,因用户雷同没有实现。

资源截图

代码片段和文件信息

package com.market.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.market.common.constant.PageConstant;
import com.market.common.constant.ResponseStatusConstant;
import com.market.common.util.DateUtil;
import com.market.common.util.ResponsResult;
import com.market.pojo.Order;
import com.market.pojo.User;
import com.market.service.OrderService;
import com.market.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @Auther:jiaxuan
 * @Date: 2019/2/25 0025 17:57
 * @Description:
 */
@Controller
@RequestMapping(“/base/order“)
public class OrderController {

    @Autowired
    private OrderService orderService;

    @Autowired
    private UserService userService;

    @ModelAttribute(“user“)
    public List loadUsers(){
        List users = userService.findAll();
        return users;
    }

    @RequestMapping(“/findAll“)
    public String findAll(Integer pageNum Model model){
        if (pageNum==null){
            pageNum= PageConstant.PAGE_NUM;
        }
        //设置分页
        PageHelper.startPage(pageNumPageConstant.PAGE_SIZE);
        List orders = orderService.findAll();

        PageInfo pageInfo = new PageInfo<>(orders);
        model.addAttribute(“pageInfo“pageInfo);

        return “Order“;
    }

    @RequestMapping(“/addorder“)
    @ResponseBody
    public ResponsResult add(Order order){
        ResponsResult result = new ResponsResult();
        Date day = new Date();
        SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-MM-dd“);
        String code = sdf.format(day).toString()+String.valueOf((int)(Math.random()*6000+1000));
        User user = new User();
        order.setCode(code);
        order.setcDate(DateUtil.getCurrentDateStr());
        order.setUserId(user);
        orderService.add(order);
        result.setStatus(ResponseStatusConstant.RESPONSE_STATUS_SUCCESS);
        result.setMessage(“添加成功“);
        return result;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-31 15:22  super_parent\
     目录           0  2019-03-31 15:22  super_parent\.idea\
     目录           0  2019-03-31 15:22  super_parent\.idea\artifacts\
     文件         323  2019-02-20 10:49  super_parent\.idea\artifacts\super_base_web_war.xml
     文件        4495  2019-02-21 19:15  super_parent\.idea\artifacts\super_base_web_war_exploded.xml
     文件         327  2019-02-20 10:49  super_parent\.idea\artifacts\super_front_web_war.xml
     文件        4502  2019-02-21 19:15  super_parent\.idea\artifacts\super_front_web_war_exploded.xml
     文件        1159  2019-02-21 19:15  super_parent\.idea\compiler.xml
     文件        1977  2019-02-23 13:58  super_parent\.idea\encodings.xml
     目录           0  2019-03-31 15:22  super_parent\.idea\libraries\
     文件         514  2019-02-20 10:49  super_parent\.idea\libraries\Maven__aopalliance_aopalliance_1_0.xml
     文件         594  2019-02-20 10:49  super_parent\.idea\libraries\Maven__commons_beanutils_commons_beanutils_1_8_0.xml
     文件         536  2019-02-20 10:49  super_parent\.idea\libraries\Maven__commons_codec_commons_codec_1_3.xml
     文件         605  2019-02-20 10:49  super_parent\.idea\libraries\Maven__commons_fileupload_commons_fileupload_1_3_2.xml
     文件         503  2019-02-20 10:49  super_parent\.idea\libraries\Maven__commons_io_commons_io_2_2.xml
     文件         558  2019-02-20 10:49  super_parent\.idea\libraries\Maven__commons_logging_commons_logging_1_2.xml
     文件         514  2019-02-20 10:49  super_parent\.idea\libraries\Maven__commons_net_commons_net_3_3.xml
     文件         493  2019-02-20 10:49  super_parent\.idea\libraries\Maven__com_alibaba_druid_1_0_16.xml
     文件         507  2019-02-20 10:49  super_parent\.idea\libraries\Maven__com_alibaba_fastjson_1_2_6.xml
     文件         547  2019-02-20 10:49  super_parent\.idea\libraries\Maven__com_github_jsqlparser_jsqlparser_1_0.xml
     文件         561  2019-02-20 10:49  super_parent\.idea\libraries\Maven__com_github_pagehelper_pagehelper_5_1_2.xml
     文件         753  2019-02-21 19:22  super_parent\.idea\libraries\Maven__com_xuan_super_super_dao_1_0_SNAPSHOT.xml
     文件         578  2019-02-20 10:49  super_parent\.idea\libraries\Maven__javax_servlet_javax_servlet_api_3_0_1.xml
     文件         510  2019-02-20 10:49  super_parent\.idea\libraries\Maven__javax_servlet_jsp_jsp_api_2_2.xml
     文件         437  2019-02-20 10:49  super_parent\.idea\libraries\Maven__jstl_jstl_1_2.xml
     文件         455  2019-02-20 10:49  super_parent\.idea\libraries\Maven__junit_junit_4_11.xml
     文件         574  2019-02-20 10:49  super_parent\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_37.xml
     文件         570  2019-02-20 10:49  super_parent\.idea\libraries\Maven__org_apache_commons_commons_pool2_2_4_2.xml
     文件         577  2019-02-20 10:49  super_parent\.idea\libraries\Maven__org_apache_httpcomponents_httpclient_4_0_2.xml
     文件         563  2019-02-20 10:49  super_parent\.idea\libraries\Maven__org_apache_httpcomponents_httpcore_4_0_1.xml
     文件         542  2019-02-20 10:49  super_parent\.idea\libraries\Maven__org_aspectj_aspectjweaver_1_8_6.xml
............此处省略618个文件信息

评论

共有 条评论