package com.example.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.CheliangxinxiInfo;
import com.example.dao.CheliangxinxiInfoDao;
import com.example.service.CheliangxinxiInfoService;
import com.example.exception.CustomException;
import com.example.common.ResultCode;
import com.example.vo.EchartsData;
import com.example.vo.CheliangxinxiInfoVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.example.service.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Value;
import cn.hutool.core.util.StrUtil;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping(value = "/cheliangxinxiInfo")
public class CheliangxinxiInfoController {
@Resource
private CheliangxinxiInfoService cheliangxinxiInfoService;
@Resource
private CheliangxinxiInfoDao cheliangxinxiInfoDao;
@PostMapping
public Result<CheliangxinxiInfo> add(@RequestBody CheliangxinxiInfoVo cheliangxinxiInfo) {
//mixmajixami
cheliangxinxiInfoService.add(cheliangxinxiInfo);
return Result.success(cheliangxinxiInfo);
}
//youtixing1
//youtixing2
@DeleteMapping("/{id}")
public Result delete(@PathVariable Long id) {
cheliangxinxiInfoService.delete(id);
return Result.success();
}
@PutMapping
public Result update(@RequestBody CheliangxinxiInfoVo cheliangxinxiInfo) {
cheliangxinxiInfoService.update(cheliangxinxiInfo);
return Result.success();
}
//@PutMapping("/update2")
// public Result update2(@RequestBody CheliangxinxiInfoVo cheliangxinxiInfo) {
// cheliangxinxiInfoService.update2(cheliangxinxiInfo);
// return Result.success();
// }
@GetMapping("/{id}")
public Result<CheliangxinxiInfo> detail(@PathVariable Long id) {
CheliangxinxiInfo cheliangxinxiInfo = cheliangxinxiInfoService.findById(id);
return Result.success(cheliangxinxiInfo);
}
@GetMapping("/searchGoods")
public Result<List<CheliangxinxiInfo>> search(@RequestParam("text") String text) {
List<CheliangxinxiInfo> cheliangxinxiInfo = cheliangxinxiInfoService.findByText(text);
return Result.success(cheliangxinxiInfo);
}
@GetMapping("/changeStatus/{id}")
public Result<CheliangxinxiInfo> changeStatus(@PathVariable Long id) {
cheliangxinxiInfoService.changeStatus(id);
return Result.success();
}
@GetMapping
public Result<List<CheliangxinxiInfoVo>> all() {
return Result.success(cheliangxinxiInfoService.findAll());
}
@GetMapping("/findAllType")
public Result<List<CheliangxinxiInfoVo>> findAllType() {
return Result.success(cheliangxinxiInfoService.findAllType());
}
@GetMapping("/findByType/{type}")
public Result<List<CheliangxinxiInfoVo>> findByType(@PathVariable String type) {
return Result.success(cheliangxinxiInfoService.findByType(type));
}
@GetMapping("/page/{name}")
public Result<PageInfo<CheliangxinxiInfoVo>> page(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "5") Integer pageSize,
HttpServletRequest request) {
return Result.success(cheliangxinxiInfoService.findPage(name, pageNum, pageSize, request));
}
@GetMapping("/pageqt/{name}")
public Result<PageInfo<CheliangxinxiInfoVo>> pageqt(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "8") Integer pageSize,
HttpServletRequest request) {
return Result.success(cheliangxinxiInfoService.findPageqt(name, pageNum, pageSize, request));
}
// @PostMapping("/register")
// public Result<CheliangxinxiInfo> register(@RequestBody CheliangxinxiInfo cheliangxinxiInfo) {
// if (StrUtil.isBlank(cheliangxinxiInfo.getName()) || StrUtil.isBlank(cheliangxinxiInfo.getPassword())) {
// throw new CustomException(ResultCode.PARAM_ERROR);
// }
// return Result.success(cheliangxinxiInfoService.add(cheliangxinxiInfo));
// }
/**
* 批量通过excel添加信息
* @param file excel文件
* @throws IOException
*/
@PostMapping("/upload")
public Result upload(MultipartFile file) throws IOException {
List<CheliangxinxiInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(CheliangxinxiInfo.class);
if (!CollectionUtil.isEmpty(infoList)) {
// 处理一下空数据
List<CheliangxinxiInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getCheliangbianhao())).collect(Collectors.toList());
for (CheliangxinxiInfo info : resultList) {
cheliangxinxiInfoService.add(info);
}
}
return Result.success();
}
@GetMapping("/get/cheliangxinxi_tj_cheliangpinpai")
Result<List<EchartsData>> cheliangxinxi_tj_cheliangpinpai() {
List<EchartsData> list = new ArrayList<>();
List<Map<String, Object>> cheliangxinxi_tj_cheliangpinpaiList = cheliangxinxiInfoDao.cheliangxinxi_tj_cheliangpinpai();
Map<String, Double> typeMap = new HashMap<>();
for (Map<String, Object> map : cheliangxinxi_tj_cheliangpinpaiList) {
typeMap.put((String)map.get("aa"), (Double.valueOf((String)map.get("bb").toString())));
}
getPieData("车辆信息按车辆品牌统计", list, typeMap);
getBarData("车辆信息按车辆品牌统计", list, typeMap);
return Result.success(list);
}
@GetMapping("/get/cheliangxinxi_tj_chexing")
Result<List<EchartsData>> cheliangxinxi_tj_chexing() {
List<EchartsData> list = new ArrayList<>();
List<Map<String, Object>> cheliangxinxi_tj_chexingList = cheliangxinxiInfoDao.cheliangxinxi_tj_chexing();
Map<String, Double> typeMap = new HashMap<>();
for (Map<String, Object> map : cheliangxinxi_tj_chexingList) {
typeMap.put((String)map.get("aa"), (Double.valueOf((String)map.get("bb").toString())));
}
getPieData("车辆信息按车型统计", list, typeMap);
getBarData("车辆信息按车型统计", list, typeMap);
return Result.success(list);
}
@GetMapping("/get/cheliangxinxi_tj_qudongfangshi")
Result<List<EchartsData>> cheliangxinxi_tj_qudongfangshi() {
List<EchartsData> list = new ArrayList<>();
List<Map<String, Object>> cheliangxinxi_tj_qudongfangshiList = cheliangxinxiInfoDao.cheliangxinxi_tj_qudongfangshi();
Map<String, Double> typeMap = new HashMap<>();
for (Map<String, Object> map : cheliangxinxi_tj_qudongfangshiList) {
typeMap.put((String)map.get("aa"), (Double.valueOf((String)map.get("bb").toString())));
}
getPieData("车辆信息�
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序新能源汽车信息安全服务平台源码数据库.zip (1079个子文件)
02add20b581be471b8d17f887b8e8337070546 194B
034ccce28a21cdd1d8500e03a3a19950a24840 135B
06718f8e6a9de9438b6501aff2f83152c53f25 2KB
06bfdeb5ad13a02a29eb9b8b8b57e1d69cedf5 124B
07d6d5f654346606542e80ea09e9983f07705c 85B
0841a689acfc75f16b91e8e49d4daa3cb01df9 831B
0887a714f0134b8dc77a89f648ad7af5219624 2KB
0c0812bb527be6b50c8a043d1e291ddd0d0b0f 135B
0f96ef21c70252c670fbb021f9ddf4e17d7e2a 2KB
132b89c93c82fb7d83523022c3d606b0cdce55 78B
136700c3f750c5b13756b0dc040c0f73168f9c 1KB
17db6db9c5f9d9ffa753ba24dbae05c63a71c6 643B
1988e9f039d279a680e8b915fe5e1d56dd385c 7KB
1a4f51d6e7d104f36ebd32906ca09c7f7ef82a 8KB
1bddcf8c0d37b912fba31db4b7261959e166b2 4KB
1d566316c654a00f15a8fa8605adcc0887ca78 134B
1d5abdfb44d57b8c2e9f70fe5e82ddc71b6040 242B
27b9ee1bdfda2aff5098f63ce7668e0bfc2d51 395B
302da08c7b072cd19358dbb503c18d08fb2143 168B
333cd8c19ff05f2b316c1e8c7d067593702854 5KB
3475a344ade362d397c92f42bafce7f4357dbd 145B
35af0699ccec004cbe685ef938cd2d63ea7037 43B
36c5aae34facbdeb0bd8ee16feba3cdacc8a2e 670B
370e54f9f9ccbc0483f91ed17cd4d0ca7d1a70 361B
395ba95c5c84d41771f4cb2b9df6cc965ee60f 1KB
39747192cd7402c2784c27bb13b8d4e6021d7a 6KB
3b32372fa0114d56ecc4e9f1d0ea4ac1ce4f5e 3KB
42709e1cd615263236d0ee23117795e95a586e 82B
47196fb87ade0fd21217c28577b489ed536b34 2KB
499d747924a8c5aa0ad42ca020ab1dcba50613 417B
50f112453e93931726340632087f9f173cfec4 965B
538c295a79e1ccc89a476f6432a0f8bbef04f9 1KB
559ee67ff7916e39e897c0ec7e140669be3ff1 676B
59f2720d04769b18523ecfd19ab1ade5ccbb9d 998B
5bf3a9933976efe33f1364f35ea29bfc1e9b26 135B
62a356e02e047d41dc875951245df07784d393 85B
6355f833fa1631a2aff819ff01633262da105e 309B
640e0dc44a0e9b160f85b9124714ea071ae7b6 39B
66f3d96d389c73495bbc9cc29d885fc5686bbf 7KB
67afb3a76618078d09086794e323dfe3a29c67 464B
69302c397adc425d760404292f4e9f519553a3 547B
6adec7200d72d6e908125b68cd1c67870bb0f8 85B
6ae0a20376ab441fbb25ed51daef83edb01fa9 135B
7021ccbae905b1e6d5242870e02123f6802b0d 85B
70aad1425a244da356e277ad9bc0607ab5f1dd 3KB
70ab1985689e06f05f658e06e2c39d05753296 407B
71f0df9ae63c39b48b150016cf5a922d540a85 673B
720f7a8e2ffa773538b1ed03222a3b7b20308f 4KB
752381bbf3cf1e8fe80266ebdf35f072df4e98 419B
763277e84151db2255d4000b7dbb91ada84a2b 1KB
767e3032a1cf829c00c7e147d494447d90652e 90B
784a5ce22115b67892b535f3c60fe024cf0e74 2KB
7aa4936e5edd996855413f9ca3fd9edcef7603 794B
7e73b461960e9b46ab3930aa4ed7ea0b252f3e 316B
7f19b5f9c2c88d7c8d0c2f5dd31a9699997f1a 388B
8114571df8026ac96009c567edbe5fef81ed09 52B
858121553fb20a1275407abcd7ee57c634fb3f 135B
87a25525aa06dba166ccdba796671feaae184b 1KB
87db04fd8716eb3a4b88f97041126b9da7bde9 761B
894d1a278e3ed8c42e639570a0ceb1ac36326c 135B
89a34ee050b5e68e6ae70f41cbfd776421f541 84B
8b9b1520e9a72765a0721ad12c58acb627039f 928B
8bb93e7ebffecf9b3a7fe1582c2d54be32f75e 345B
8e4079810a018090ba597cc7a7afd41ea79bfb 2KB
8f6d71951e182e79255a2b94cb4ea4aa840da5 134B
8fb1d865a89e6d04e3a0c387535ad4d6aa34c0 1KB
92d638e2a2710cc72eac649710cbf560127d22 1KB
968af357ba7583984746b29aa400ff1bcb224c 245B
96f859f54e491950d60868ef72455f47fac058 464B
97c9bf6abab5bfb1d540e49408165e52cdeff3 151B
9960aa4c4d20d830655c87be19faa59a01682c 134B
9c108783e453961d68b9f44a7dd505927a380f 1KB
9cee8e7b376a4b493efd229ef5246561865764 135B
9d7c0880fe6a8db908fe6e365c370df7aaccb6 135B
9da67f1cdf39347ffd1ad0cb4012580cf34415 832B
9df324b450d0cb30d6cd6ee76845ba67ab748e 72B
a262d800b44df5ce408b97627d6711a064c07c 982B
a4ad3f5871c4b3815694f776d304ae29851227 48B
a7e960684704ca3d756a2719cd0e554aa5396c 850B
a803e63eeee1a27918f6c36ca41c80ea7933c8 85B
aba0b2d291bbf2ad9178ed9a8c621ca523b888 134B
ac38830e1d734727cdf659c6d6005674f8167e 805B
af40cadf2e21c8e03aa284fb4af3e7eeacc82b 788B
b9149ea2f49f24e39fd6a3e78241969a6b48a4 408B
b9902204bec6686f1c9b066ef459979346c4c4 2KB
bef88f62c0e917ecb8d4dda3e422983063e6bf 466B
bfff5b56c4101296ce2867851ade06ca86af48 226B
c0b5583ff1d87aefdd9035cf351b888ad41503 2KB
c47546807d4b6d68d54c46bb334ed13a21c4cb 136B
c4afc6d123f8ca861ce4ad3200fcc47c34e075 375B
ca58b388c66119887731fcab9dd57f1e2c6836 12KB
cfa20722ff7572d4c4a3023b776559ed9be1f2 1006B
CheliangxinxiInfoController.class 16KB
GoumaiInfoController.class 14KB
ShangpinxinxiInfoController.class 14KB
WodecheliangInfoController.class 13KB
DingdanxinxiInfoController.class 13KB
ZhuceyonghuInfoController.class 13KB
ShangpinleibieInfoController.class 12KB
YonghuleixingInfoController.class 12KB
共 1079 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
知一NN
- 粉丝: 42
- 资源: 4157
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功