基于javaweb和mysql的springboot银行柜台管理系统(vue+element+java+springboot+maven+mybaits+mysql)
管理员角色主要功能如下: 系统用户管理:管理员用户、修改密码;用户管理:用户查询、新增、编辑、删除等;取款管理:用户查询、新增、编辑、删除等;存款管理:用户查询、新增、编辑、删除等;转账管理:用户查询、新增、编辑、删除等;取款管理:用户查询、新增、编辑、删除等;存款管理:用户查询、新增、编辑、删除等;转账管理:用户查询、新增、编辑、删除等;基于javaweb和mysql的springboot银行柜
基于javaweb和mysql的springboot银行柜台管理系统(vue+element+java+springboot+maven+mybaits+mysql)
私信源码获取及调试交流
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot银行柜台管理系统(vue+element+java+springboot+maven+mybaits+mysql)
项目介绍
Springboot银行柜面管理系统主要分为管理员与用户两种角色。 管理员角色主要功能如下: 系统用户管理:管理员用户、修改密码; 用户管理:用户查询、新增、编辑、删除等; 取款管理:用户查询、新增、编辑、删除等; 存款管理:用户查询、新增、编辑、删除等; 转账管理:用户查询、新增、编辑、删除等;
普通用户主要功能如下: 个人资料管理:修改个人资料、修改密码; 取款管理:用户查询、新增、编辑、删除等; 存款管理:用户查询、新增、编辑、删除等; 转账管理:用户查询、新增、编辑、删除等;
技术栈
后端:SpringBoot+Mybaits
前端:Html+css+element+jquery+bootstrap+vue
@RestController
public class AccountController {
@Value("${authority.info}")
private String authorityStr;
@Resource
private AdminInfoService adminInfoService;
@Resource
private YonghuInfoService yonghuInfoService;
@PostMapping("/login")
public Result<Account> login(@RequestBody Account account, HttpServletRequest request) {
if (StrUtil.isBlank(account.getUsername()) || StrUtil.isBlank(account.getMima()) || account.getLevel() == null) {
throw new CustomException(ResultCode.PARAM_LOST_ERROR);
}
String level = account.getLevel();
Account login = new Account();
if (level.equals("管理员")) {
login = adminInfoService.login(account.getUsername(), account.getMima());
}
if (level.equals("用户")) {
* @throws IOException
*/
@PostMapping("/upload")
public Result upload(MultipartFile file) throws IOException {
List<QukuanInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(QukuanInfo.class);
if (!CollectionUtil.isEmpty(infoList)) {
// 处理一下空数据
List<QukuanInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getQukuanjine())).collect(Collectors.toList());
for (QukuanInfo info : resultList) {
qukuanInfoService.add(info);
}
}
return Result.success();
}
//yoxutonxgjitu
@GetMapping("/getExcelModel")
public void getExcelModel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("qukuanjine", "A取款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "qukuan");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=qukuanInfoModel.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
IoUtil.close(System.out);
}
@GetMapping("/getExcel")
}
}
return Result.success();
}
//yoxutonxgjitu
@GetMapping("/getExcelModel")
public void getExcelModel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("qukuanjine", "A取款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "qukuan");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=qukuanInfoModel.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
IoUtil.close(System.out);
}
@GetMapping("/getExcel")
public void getExcel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("qukuanjine", "A取款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "权限");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
List<Map<String, Object>> daochuexcellist = qukuanInfoDao.daochuexcel();
return Result.success(map);
}
//youtongji
// @GetMapping("/get/tj_shangpinxiaoliang")
// Result<List<EchartsData>> getTj_shangpinxiaoliang_EchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> shangpinxiaoliangList = shangpinchukuInfoDao.select_tj_xiaoliang();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : shangpinxiaoliangList) {
//
// 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/shopping")
// Result<List<EchartsData>> getShoppingEchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> typePriceList = orderInfoDao.getTypeCount();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : typePriceList) {
// typeMap.put((String)map.get("name"), ((BigDecimal)map.get("count")).doubleValue());
// }
// getPieData("分类总销量", list, typeMap);
// getBarData("分类总销量", list, typeMap);
// return Result.success(list);
// }
// @GetMapping("/get/price")
// Result<List<EchartsData>> getPriceEchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> typePriceList = orderInfoDao.getTypePrice();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : typePriceList) {
// typeMap.put((String)map.get("name"), (Double)map.get("price"));
// }
// getPieData("分类总销售额", list, typeMap);
// getBarData("分类总销售额", list, typeMap);
// return Result.success(list);
// }
public Result update(@RequestBody RichtextInfoVo info) {
richtextInfoService.update(info);
return Result.success();
}
@GetMapping("/{id}")
public Result<RichtextInfo> detail(@PathVariable Long id) {
RichtextInfo info = richtextInfoService.findById(id);
return Result.success(info);
}
@GetMapping
public Result<List<RichtextInfoVo>> all() {
return Result.success(richtextInfoService.findAll());
}
@GetMapping("/page/{name}")
public Result<PageInfo<RichtextInfoVo>> page(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "5") Integer pageSize,
HttpServletRequest request) {
return Result.success(richtextInfoService.findPage(name, pageNum, pageSize, request));
}
}
@RestController
@RequestMapping(value = "/qukuanInfo")
public class QukuanInfoController {
@Resource
private QukuanInfoService qukuanInfoService;
@Resource
private QukuanInfoDao qukuanInfoDao;
@PostMapping
public Result<QukuanInfo> add(@RequestBody QukuanInfoVo qukuanInfo) {
//mixmajixami
qukuanInfoService.add(qukuanInfo);
return Result.success(qukuanInfo);
}
//youtixing1
//youtixing2
@DeleteMapping("/{id}")
public Result delete(@PathVariable Long id) {
qukuanInfoService.delete(id);
return Result.success();
}
@PutMapping
public Result update(@RequestBody QukuanInfoVo qukuanInfo) {
qukuanInfoService.update(qukuanInfo);
return Result.success();
}
//@PutMapping("/update2")
// public Result update2(@RequestBody QukuanInfoVo qukuanInfo) {
// qukuanInfoService.update2(qukuanInfo);
// return Result.success();
// }
@GetMapping("/{id}")
public Result<QukuanInfo> detail(@PathVariable Long id) {
QukuanInfo qukuanInfo = qukuanInfoService.findById(id);
@Service
public class QukuanInfoService {
@Resource
private QukuanInfoDao qukuanInfoDao;
@Resource
private YonghuInfoDao yonghuInfoDao;
public QukuanInfo add(QukuanInfo qukuanInfo) {
//shangxchxuantupxian
// 唯一校验
// qukuanInfo.setAccount((double) 0);
YonghuInfo yonghuInfo = yonghuInfoDao.selectByKahao(qukuanInfo.getKahao());
yonghuInfo.setKashangjine(String.valueOf(Integer.valueOf(yonghuInfo.getKashangjine())-Integer.valueOf(qukuanInfo.getQukuanjine())));
yonghuInfoDao.updateByPrimaryKeySelective(yonghuInfo);
qukuanInfoDao.insertSelective(qukuanInfo);
return qukuanInfo;
}
public void delete(Long id) {
qukuanInfoDao.deleteByPrimaryKey(id);
}
public void update(QukuanInfo qukuanInfo) {
//shangxchxuantupxian
//youdianzan
qukuanInfoDao.updateByPrimaryKeySelective(qukuanInfo);
}
public QukuanInfo findById(Long id) {
return qukuanInfoDao.selectByPrimaryKey(id);
}
public List<QukuanInfoVo> findAll() {
return qukuanInfoDao.findByQukuanjine("all");
}
public PageInfo<QukuanInfoVo> findPage(String qukuanjine, Integer pageNum, Integer pageSize, HttpServletRequest request) {
PageHelper.startPage(pageNum, pageSize);
return PageInfo.of(all);
}
public PageInfo<QukuanInfoVo> findPageqt(String qukuanjine, Integer pageNum, Integer pageSize, HttpServletRequest request) {
PageHelper.startPage(pageNum, pageSize);
List<QukuanInfoVo> all=null;
Account user = (Account) request.getSession().getAttribute("user");
all = qukuanInfoDao.findByQukuanjine(qukuanjine);
if (user.getLevel().equals("用户")) {all = qukuanInfoDao.findByQukuanjinelist2(qukuanjine,user.getKahao()); }
return PageInfo.of(all);
}
// public QukuanInfoVo findByUserName(String name) {
// return qukuanInfoDao.findByUsername(name);
// }
//yoxulogindenxglu
public void changeStatus(Long id) {
QukuanInfo qukuanInfo = qukuanInfoDao.selectByPrimaryKey(id);
if(qukuanInfo.getStatus().equals("是")){
qukuanInfo.setStatus("否");
qukuanInfoDao.updateByPrimaryKey(qukuanInfo);
}else if(qukuanInfo.getStatus().equals("否")){
qukuanInfo.setStatus("是");
qukuanInfoDao.updateByPrimaryKey(qukuanInfo);
}
}
//ddaizdhifu
//youtixing
}
public Result<PageInfo<NxSystemFileInfo>> filePage(@PathVariable String name,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize) {
PageInfo<NxSystemFileInfo> pageInfo = nxSystemFileInfoService.findPage(name, pageNum, pageSize);
return Result.success(pageInfo);
}
@GetMapping("/download/{id}")
public void download(@PathVariable String id, HttpServletResponse response) throws IOException {
if ("null".equals(id)) {
throw new CustomException("1001", "您未上传文件");
}
NxSystemFileInfo nxSystemFileInfo = nxSystemFileInfoService.findById(Long.parseLong(id));
if (nxSystemFileInfo == null) {
throw new CustomException("1001", "未查询到该文件");
}
byte[] bytes = FileUtil.readBytes(BASE_PATH + nxSystemFileInfo.getFileName());
response.reset();
// 设置response的Header
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(nxSystemFileInfo.getOriginName(), "UTF-8"));
response.addHeader("Content-Length", "" + bytes.length);
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
response.setContentType("application/octet-stream");
toClient.write(bytes);
toClient.flush();
toClient.close();
}
@DeleteMapping("/{id}")
public Result deleteFile(@PathVariable String id) {
NxSystemFileInfo nxSystemFileInfo = nxSystemFileInfoService.findById(Long.parseLong(id));
if (nxSystemFileInfo == null) {
throw new CustomException("1001", "未查询到该文件");
}
String name = nxSystemFileInfo.getFileName();
// 先删除文件
FileUtil.del(new File(BASE_PATH + name));
// 再删除表记录
nxSystemFileInfoService.delete(Long.parseLong(id));
return Result.success();
}
@GetMapping("/{id}")
public Result<NxSystemFileInfo> getById(@PathVariable String id) {
NxSystemFileInfo nxSystemFileInfo = nxSystemFileInfoService.findById(Long.parseLong(id));
if (nxSystemFileInfo == null) {
throw new CustomException("1001", "数据库未查到此文件");
}
try {
FileUtil.readBytes(BASE_PATH + nxSystemFileInfo.getFileName());
} catch (Exception e) {
throw new CustomException("1001", "此文件已被您删除");
// }
// }
request.getSession().setAttribute("user", login);
return Result.success(login);
}
@GetMapping("/logout")
public Result logout(HttpServletRequest request) {
request.getSession().setAttribute("user", null);
return Result.success();
}
@GetMapping("/auth")
public Result getAuth(HttpServletRequest request) {
Object user = request.getSession().getAttribute("user");
if(user == null) {
return Result.error("401", "未登录");
}
return Result.success(user);
}
@GetMapping("/getAccountInfo")
public Result<Object> getAccountInfo(HttpServletRequest request) {
Account account = (Account) request.getSession().getAttribute("user");
if (account == null) {
return Result.success(new Object());
}
String level = account.getLevel();
if (level.equals("管理员")) {
return Result.success(adminInfoService.findById(account.getId()));
}
if (level.equals("用户")) { return Result.success(yonghuInfoService.findById(account.getId())); }
// if (level.equals("管理员")) {
// return Result.success(sellerInfoService.findById(account.getId()));
// }
// if (level.equals("用户")) {
// return Result.success(userInfoService.findById(account.getId()));
// }
//
// if (level.equals("医生")) {
// return Result.success(yishengxinxiInfoService.findById(account.getId()));
// }
// if (level.equals("员工")) {
// return Result.success(yuangongxinxiInfoService.findById(account.getId()));
// }
return Result.success(new Object());
}
for (CunkuanInfo info : resultList) {
cunkuanInfoService.add(info);
}
}
return Result.success();
}
//yoxutonxgjitu
@GetMapping("/getExcelModel")
public void getExcelModel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("cunkuanjine", "A存款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "cunkuan");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=cunkuanInfoModel.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
IoUtil.close(System.out);
}
@GetMapping("/getExcel")
public void getExcel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("cunkuanjine", "A存款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "权限");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// }
// if (level.equals("员工")) {
// YuangongxinxiInfo info = yuangongxinxiInfoService.findByGonghao(account.getGonghao());
// if (info == null) {
// return Result.error(ResultCode.USER_NOT_EXIST_ERROR.code, ResultCode.USER_NOT_EXIST_ERROR.msg);
// }
// info.setMima(SecureUtil.md5("123456"));
// yuangongxinxiInfoService.update(info);
//
// }
return Result.success();
}
}
@RestController
}
// @PostMapping("/register")
// public Result<CunkuanInfo> register(@RequestBody CunkuanInfo cunkuanInfo) {
// if (StrUtil.isBlank(cunkuanInfo.getName()) || StrUtil.isBlank(cunkuanInfo.getPassword())) {
// throw new CustomException(ResultCode.PARAM_ERROR);
// }
// return Result.success(cunkuanInfoService.add(cunkuanInfo));
// }
/**
* 批量通过excel添加信息
* @param file excel文件
* @throws IOException
*/
@PostMapping("/upload")
public Result upload(MultipartFile file) throws IOException {
List<CunkuanInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(CunkuanInfo.class);
if (!CollectionUtil.isEmpty(infoList)) {
// 处理一下空数据
List<CunkuanInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getCunkuanjine())).collect(Collectors.toList());
for (CunkuanInfo info : resultList) {
cunkuanInfoService.add(info);
}
}
return Result.success();
}
//yoxutonxgjitu
@GetMapping("/getExcelModel")
public void getExcelModel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("cunkuanjine", "A存款金额");
row.put("zhifumima", "A支付密码");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "cunkuan");
// info.setMima(SecureUtil.md5("123456"));
// userInfoService.update(info);
// }
// if (level.equals("医生")) {
// YishengxinxiInfo info = yishengxinxiInfoService.findByUserName(account.getXingming());
// if (info == null) {
// return Result.error(ResultCode.USER_NOT_EXIST_ERROR.code, ResultCode.USER_NOT_EXIST_ERROR.msg);
// }
// info.setPassword(SecureUtil.md5("123456"));
// yishengxinxiInfoService.update(info);
//
// }
// if (level.equals("员工")) {
// YuangongxinxiInfo info = yuangongxinxiInfoService.findByGonghao(account.getGonghao());
// if (info == null) {
// return Result.error(ResultCode.USER_NOT_EXIST_ERROR.code, ResultCode.USER_NOT_EXIST_ERROR.msg);
// }
// info.setMima(SecureUtil.md5("123456"));
// yuangongxinxiInfoService.update(info);
//
// }
return Result.success();
}
}
* @param file excel文件
* @throws IOException
*/
@PostMapping("/upload")
public Result upload(MultipartFile file) throws IOException {
List<ZhuanzhangInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(ZhuanzhangInfo.class);
if (!CollectionUtil.isEmpty(infoList)) {
// 处理一下空数据
List<ZhuanzhangInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getZhuanzhangjine())).collect(Collectors.toList());
for (ZhuanzhangInfo info : resultList) {
zhuanzhangInfoService.add(info);
}
}
return Result.success();
}
//yoxutonxgjitu
@GetMapping("/getExcelModel")
public void getExcelModel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("zhuanzhangjine", "A转账金额");
row.put("zhifumima", "A支付密码");
row.put("duifangkahao", "A对方卡号");
row.put("duifangxingming", "A对方姓名");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "zhuanzhang");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=zhuanzhangInfoModel.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
// 获取总销量
// map.put("totalShopping", orderGoodsRelDao.totalShopping() == null ? 0 : orderGoodsRelDao.totalShopping());
return Result.success(map);
}
//youtongji
// @GetMapping("/get/tj_shangpinxiaoliang")
// Result<List<EchartsData>> getTj_shangpinxiaoliang_EchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> shangpinxiaoliangList = shangpinchukuInfoDao.select_tj_xiaoliang();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : shangpinxiaoliangList) {
//
// 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/shopping")
// Result<List<EchartsData>> getShoppingEchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> typePriceList = orderInfoDao.getTypeCount();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : typePriceList) {
// typeMap.put((String)map.get("name"), ((BigDecimal)map.get("count")).doubleValue());
// }
// getPieData("分类总销量", list, typeMap);
// getBarData("分类总销量", list, typeMap);
// return Result.success(list);
// }
// @GetMapping("/get/price")
// Result<List<EchartsData>> getPriceEchartsData() {
// List<EchartsData> list = new ArrayList<>();
// List<Map<String, Object>> typePriceList = orderInfoDao.getTypePrice();
// Map<String, Double> typeMap = new HashMap<>();
// for (Map<String, Object> map : typePriceList) {
// typeMap.put((String)map.get("name"), (Double)map.get("price"));
// }
// getPieData("分类总销售额", list, typeMap);
// getBarData("分类总销售额", list, typeMap);
// return Result.success(list);
// }
private void getPieData(String name, List<EchartsData> pieList, Map<String, Double> dataMap) {
EchartsData pieData = new EchartsData();
EchartsData.Series series = new EchartsData.Series();
row.put("level", "zhuanzhang");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=zhuanzhangInfoModel.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
IoUtil.close(System.out);
}
@GetMapping("/getExcel")
public void getExcel(HttpServletResponse response) throws IOException {
// 1. 生成excel
Map<String, Object> row = new LinkedHashMap<>();
row.put("zhuanzhangjine", "A转账金额");
row.put("zhifumima", "A支付密码");
row.put("duifangkahao", "A对方卡号");
row.put("duifangxingming", "A对方姓名");
row.put("kahao", "A卡号");
row.put("xingming", "A姓名");
row.put("kashangjine", "A卡上金额");
row.put("status", "是");
row.put("level", "权限");
List<Map<String, Object>> list = CollUtil.newArrayList(row);
List<Map<String, Object>> daochuexcellist = zhuanzhangInfoDao.daochuexcel();
Map<String, Double> typeMap = new HashMap<>();
for (Map<String, Object> map : daochuexcellist) {
list.add(map);
}
// 2. 写excel
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.write(list, true);
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename=zhuanzhangInfo.xlsx");
ServletOutputStream out = response.getOutputStream();
writer.flush(out, true);
writer.close();
更多推荐
所有评论(0)