资源简介

使用idea整合的ssm框架,功能有查询,修改,删除,分页 1、创建数据库名为:crm 将本工程提供的crm数据导入到crm中 2、工程数据库管理在:jdbc.properties 3、工程采用:maven创建

资源截图

代码片段和文件信息

package com.itheima.crm.controller;


import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.itheima.crm.pojo.baseDict;

import com.itheima.crm.pojo.Customer;
import com.itheima.crm.pojo.QueryVo;
import com.itheima.crm.service.baseDictService;
import com.itheima.crm.service.CustomerService;
import com.itheima.crm.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @version V1.0
 * @ClassName:CustomerController
 * @Description:客户请求处理
 * @author:cxg
 * @Date:${time}
 */
@Controller
@RequestMapping(“customer“)
public class CustomerController {

    @Autowired
    public baseDictService baseDictService;

    @Autowired
    public CustomerService customerService;
    @Value(“${customer_from_type}“)
    private String customer_from_type;

    @Value(“${customer_industry_type}“)
    private String customer_industry_type;

    @Value(“${customer_level_type}“)
    private String customer_level_type;


    @RequestMapping(“list“)
    public String list(Model modelQueryVo vo) {
        //查询来源
        ListseDict> fromType=baseDictService.getbaseDictByCode(customer_from_type);
        //所属行业
        ListseDict> industryType=baseDictService.getbaseDictByCode(customer_industry_type);
        //客户级别
        ListseDict> levelType=baseDictService.getbaseDictByCode(customer_level_type);
        model.addAttribute(“fromType“fromType);
        model.addAttribute(“industryType“industryType);
        model.addAttribute(“levelType“levelType);

        //根据查询条件分页查询用户列表
        Page page= customerService.getCustomerByQueryVo(vo);
        //设置分页数据返回
        model.addAttribute(“page“page);
        //返回查询条件
        model.addAttribute(“vo“ vo);
        return “customer“;
    }
    @RequestMapping(“edit“)
    @ResponseBody
    public Customer edit(Integer id){
        Customer customer= customerService.getCustomerById(id);
        return  customer;
    }
    @RequestMapping(“update“)
    @ResponseBody
    public String update(Customer customer){
        String msg = “1“;
        try {
            customerService.updateCustomer(customer);
            msg = “0“;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return msg;
    }
    @RequestMapping(“delete“)
    @ResponseBody
    public String deleteCustomer(Integer id) {
        customerService.deleteCustomer(id);
        return “ok“;
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        300  2018-08-30 10:41  crm_cxg\.idea\artifacts\crm_cxg_war.xml

     文件       4004  2018-08-30 19:12  crm_cxg\.idea\artifacts\crm_cxg_war_exploded.xml

     文件        626  2018-08-30 18:22  crm_cxg\.idea\compiler.xml

     文件        172  2018-08-29 13:56  crm_cxg\.idea\encodings.xml

     文件       1562  2018-08-30 18:01  crm_cxg\.idea\inspectionProfiles\Project_Default.xml

     文件        558  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__commons_logging_commons_logging_1_2.xml

     文件        486  2018-08-30 19:12  crm_cxg\.idea\libraries\Maven__com_alibaba_druid_1_1_9.xml

     文件        522  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__com_fasterxml_classmate_1_3_1.xml

     文件        644  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml

     文件        595  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_core_2_8_8.xml

     文件        623  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_databind_2_8_8.xml

     文件        561  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__com_github_jsqlparser_jsqlparser_0_9_5.xml

     文件        561  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__com_github_pagehelper_pagehelper_5_0_0.xml

     文件        578  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__javax_servlet_javax_servlet_api_3_0_1.xml

     文件        494  2018-08-30 20:38  crm_cxg\.idea\libraries\Maven__javax_servlet_jsp_api_2_0.xml

     文件        522  2018-08-30 20:38  crm_cxg\.idea\libraries\Maven__javax_servlet_servlet_api_2_4.xml

     文件        611  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__javax_validation_validation_api_1_1_0_Final.xml

     文件        437  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__jstl_jstl_1_2.xml

     文件        455  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__junit_junit_4_12.xml

     文件        469  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__log4j_log4j_1_2_17.xml

     文件        574  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_41.xml

     文件        542  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_aspectj_aspectjweaver_1_8_9.xml

     文件        532  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xml

     文件        634  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_hibernate_hibernate_validator_5_4_1_Final.xml

     文件        608  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_jboss_logging_jboss_logging_3_3_0_Final.xml

     文件        645  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_mybatis_generator_mybatis_generator_core_1_3_5.xml

     文件        500  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_mybatis_mybatis_3_4_2.xml

     文件        549  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_mybatis_mybatis_spring_1_3_1.xml

     文件        609  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_springframework_spring_aop_4_3_7_RELEASE.xml

     文件        637  2018-08-30 19:11  crm_cxg\.idea\libraries\Maven__org_springframework_spring_aspects_4_3_7_RELEASE.xml

............此处省略243个文件信息

评论

共有 条评论

相关资源