Idea激活2022.1(保险业务与分析系统 IntelliJ IDEA 2022.1.3 Visual Studio Code)

Idea激活2022.1(保险业务与分析系统 IntelliJ IDEA 2022.1.3 Visual Studio Code)

package com.example.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.example.Service.CustomerService; import com.example.pojo.Customer; import com.example.pojo.Insure; import com.example.pojo.Report; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.*; @RestController //说明当前类是控制层的类,返回的数据是json @CrossOrigin //在服务器端支持跨域访问 @RequestMapping(“/customer”) //设置当前类的请求路径 public class CustomerController { @Autowired private CustomerService customerService; /* * 响应方法: * 处理前端显示客户信息的请求方法–显示分页 * */ @RequestMapping(“getOnePage”) //设置当前方法的请求路径 public Map<String,Object> getOnePage(Integer page,Integer limit){ IPage<Customer> onePage= customerService.getOnePage(page, limit); //将查到的信息构造成的map格式,以便前端使用 HashMap<String,Object> map=new HashMap<>(); map.put(“code”,0); map.put(“msg”,””); map.put(“count”,onePage.getTotal()); //getTotal()获取onePage中所有的记录数 map.put(“data”,onePage.getRecords()); //getRecords()获取onePage中所有记录 return map; } @RequestMapping(“getOnePagecus_name”) //设置当前方法的请求路径 public Map<String,Object> getOnePagecus_name(Integer page,Integer limit,String cus_name){ IPage<Customer> onePage= customerService.getOnePagecus_name(page, limit,cus_name); //将查到的信息构造成的map格式,以便前端使用 HashMap<String,Object> map=new HashMap<>(); map Idea激活2022.1.put(“code”,0); map.put(“msg”,””); map.put(“count”,onePage.getTotal()); //getTotal()获取onePage中所有的记录数 map.put(“data”,onePage.getRecords()); //getRecords()获取onePage中所有记录 return map; } @RequestMapping(“getOnePagecus_industry”) //设置当前方法的请求路径 public Map<String,Object> getOnePagecus_industry(Integer page,Integer limit,Integer cus_industry){ IPage<Customer> onePage= customerService.getOnePagecus_industry(page, limit,cus_industry); //将查到的信息构造成的map格式,以便前端使用 HashMap<String,Object> map=new HashMap<>(); map.put(“code”,0); map.put(“msg”,””); map.put(“count”,onePage.getTotal()); //getTotal()获取onePage中所有的记录数 map.put(“data”,onePage.getRecords()); //getRecords()获取onePage中所有记录 return map; } @RequestMapping(“getOnePagecus_region”) //设置当前方法的请求路径 public Map<String,Object> getOnePagecus_region(Integer page,Integer limit,Integer cus_region){ IPage<Customer> onePage= customerService.getOnePagecus_region(page, limit,cus_region); //将查到的信息构造成的map格式,以便前端使用 HashMap<String,Object> map=new HashMap<>(); map.put(“code”,0); map.put(“msg”,””); map.put(“count”,onePage.getTotal()); //getTotal()获取onePage中所有的记录数 map.put(“data”,onePage.getRecords()); //getRecords()获取onePage中所有记录 return map; } @RequestMapping(“getOnePagecus_satisfy”) //设置当前方法的请求路径 public Map<String,Object> getOnePagecus_satisfy(Integer page,Integer limit,Integer cus_satisfy){ IPage<Customer> onePage= customerService.getOnePagecus_satisfy(page, limit,cus_satisfy); //将查到的信息构造成的map格式,以便前端使用 HashMap<String,Object> map=new HashMap<>(); map.put(“code”,0); map.put(“msg”,””); map.put(“count”,onePage.getTotal()); //getTotal()获取onePage中所有的记录数 map.put(“data”,onePage.getRecords()); //getRecords()获取onePage中所有记录 return map; } /* * 响应前端修改客户信息请求 * */ @RequestMapping(“/update”) public Map<String,Object> update(Customer customer){ //1.调用service中的修改方法,并获取修改结果 Boolean flag = customerService.update(customer); //2.构造返回的数据–修改成功或失败 HashMap<String, Object> map = new HashMap<>(); if(flag){ map.put(“msg”,”修改成功”); } else { map.put(“msg”,”修改失败”); } return map; } //响应前端的添加客户信息的请求 @RequestMapping(“/add”) public Map<String,Object> add(Customer customer){ //1.调用service中的修改方法,并获取修改结果 Boolean flag = customerService.add(customer); //2.构造返回的数据–修改成功或失败 HashMap<String, Object> map = new HashMap<>(); if(flag){ map.put(“msg”,”添加成功”); } else { map.put(“msg”,”添加失败”); } return map; } /* * 响应前端删除客户信息的请求 * */ @RequestMapping(“/delete”) public Map<String,Object> delete(Integer [] ids){ //Arrays.asList(ids)将ids数组转化为List<Integer> Boolean flag = customerService.delete(Arrays.asList(ids)); HashMap<String, Object> map = new HashMap<>(); if(flag){ map.put(“msg”,”删除成功”); } else { map.put(“msg”,”删除失败”); } return map; } @RequestMapping(“/deleteid”) public Map<String,Object> deleteid(Integer cus_id){ //Arrays.asList(ids)将ids数组转化为List<Integer> Boolean flag = customerService.deleteid(cus_id); HashMap<String, Object> map = new HashMap<>(); if(flag){ map.put(“msg”,”删除成功”); } else { map.put(“msg”,”删除失败”); } return map; } @RequestMapping(“/getCusliushi”) public Map<String,Object> getCusliushi(){//流失客户 List<Customer> List = customerService.getCusliushi(); HashMap<String, Object> map = new HashMap<>(); if(!List.isEmpty()) { map.put(“code”, 0); //正确 map.put(“msg”,””); map.put(“data”, List); } else { map.put(“code”,1); //错误 map.put(“msg”, “沒有流失客戶信息”); } return map; } @RequestMapping(“/getCuscommon”) public Map<String,Object> getCuscommon(){//正常客户 List<Customer> List = customerService.getCuscommon(); HashMap<String, Object> map = new HashMap<>(); if(!List.isEmpty()) { map.put(“code”, 0); //正确 map.put(“msg”,””); map.put(“data”, List); } else { map.put(“code”,1); //错误 map.put(“msg”, “沒有该信息”); } return map; } /* * 响应获取客户地区及其客户数量的方法 * */ @RequestMapping(“/getCusNumByRegion”) public Map<String,Object> getCusNumByRegion(){ //1.获取reportlist Idea激活2022.1 //2.将reportlist中的item和num分别存放到xdata和ydata中 List<Report> reportList = customerService.getCusNumByRegion(); ArrayList<String> xdata = new ArrayList<>(); ArrayList<Integer> ydata = new ArrayList<>(); for(Report report:reportList){//for循环读取reportList里的数据 String item = report.getItem(); switch (item){ case “1”:

2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/174511.html

(0)
上一篇 2024年 7月 31日
下一篇 2024年 7月 31日

相关推荐

关注微信