package com.itheima.crm.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; 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 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; /** * 客户信息请求请求处理 * * @author Steven * */ @Controller @RequestMapping("customer") public class CustomerController { @Autowired private BaseDictService dictService; @Autowired private 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 model,QueryVo vo) { // 查询来源 List<BaseDict> fromType = dictService.getBaseDictByCode(customer_from_type); // 查询行业 List<BaseDict> industryType = dictService.getBaseDictByCode(customer_industry_type); // 查询级别 List<BaseDict> levelType = dictService.getBaseDictByCode(customer_level_type); // 设置数据模型返回 model.addAttribute("fromType", fromType); model.addAttribute("industryType", industryType); model.addAttribute("levelType", levelType); //跟据查询条件分页查询用户列表 Page<Customer> 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 delete(Integer id){ String msg = "1"; try { customerService.deleteCustomer(id); msg = "0"; } catch (Exception e) { e.printStackTrace(); } return msg; } @RequestMapping("myTag") public String myTage() { return "myTag"; } }

三秋桂子 LV1
2024年12月21日
微信网友_7151914139078656 LV2
2024年9月4日
chn-lei LV2
2024年8月5日
pangzhihui LV14
2024年4月17日
2131234536546 LV7
2024年3月31日
6389181 LV7
2023年6月1日
zhunishimian LV6
2023年5月22日
mnb123 LV6
2023年3月16日
邬松桥 LV11
2022年11月17日
Web项目聚集地 LV24
2022年10月21日

cq1458824624
1月14日
暂无贡献等级
xiaoaitx LV8
1月1日
xiuele
2024年12月26日
暂无贡献等级
三秋桂子 LV1
2024年12月21日
xinshou11111x
2024年12月17日
暂无贡献等级
geekcjj LV18
2024年11月9日
bluerstar LV1
2024年10月21日
Peny_ZH LV5
2024年9月21日
weilaizhisheng LV21
2024年9月9日
255921158 LV5
2024年9月9日