| | |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TApplyChargingPileDTO dto) { |
| | | // 验证验证码 |
| | | String code = redisService.getCacheObject(dto.getLandlordPhone() + Constants.APPLY_CHARGING); |
| | | String code; |
| | | if(dto.getLandlordHandling().equals(1)){ |
| | | code = redisService.getCacheObject(dto.getLandlordPhone() + Constants.APPLY_CHARGING); |
| | | }else { |
| | | code = redisService.getCacheObject(dto.getAgentPhone() + Constants.APPLY_CHARGING); |
| | | } |
| | | if(StringUtils.isEmpty(code)){ |
| | | return AjaxResult.error("验证码已过期,请重新获取验证码!"); |
| | | } |
| | |
| | | try { |
| | | // excel模板封装 |
| | | ExcelWriterBuilder excelWriterBuilder = EasyExcelFactory.write(response.getOutputStream()); |
| | | InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("template/" +"运营商名称1-充电桩名称1-结算对账单明细-结算月份1" + ".xlsx"); |
| | | InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("template/" +"结算汇总" + ".xlsx"); |
| | | // 自动释放资源 |
| | | try (ExcelWriter excelWriter = excelWriterBuilder.withTemplate(stream).build()) { |
| | | WriteSheet writeSheet = EasyExcel.writerSheet().build(); |