| | |
| | | import com.ruoyi.chargingPile.api.vo.GunStatusStatisticsVO; |
| | | import com.ruoyi.chargingPile.api.vo.SiteNameVO; |
| | | import com.ruoyi.chargingPile.api.vo.TChargingGunVO; |
| | | import com.ruoyi.chargingPile.config.FileUploadConfig; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | |
| | | |
| | | @Autowired |
| | | private TChargingGunService chargingGunService; |
| | | @Autowired |
| | | @Resource |
| | | private ChargingOrderClient chargingOrderClient; |
| | | |
| | | @Resource |
| | | private TChargingPileService chargingPileService; |
| | | @Resource |
| | | private ISiteService siteService; |
| | | |
| | | @Autowired |
| | | private FileUploadConfig fileUploadConfig; |
| | | |
| | | /** |
| | | * 查询充电枪列表 |
| | |
| | | public void downloadQRCode(@PathVariable Integer id, HttpServletResponse response){ |
| | | try { |
| | | TChargingGun chargingGun = chargingGunService.getById(id); |
| | | String fileName = URLEncoder.encode(chargingGun.getCode(), "UTF-8") + ".jpg"; |
| | | TChargingPile chargingPile = chargingPileService.getById(chargingGun.getId()); |
| | | String code = chargingPile.getCode() + chargingGun.getCode(); |
| | | String fileName = URLEncoder.encode(code, "UTF-8") + ".jpg"; |
| | | response.setContentType("application/force-download"); |
| | | response.addHeader("Content-Disposition", "attachment;fileName=" + fileName); |
| | | String url = "https://www.baidu.com?id=" + id; |
| | | String filePath = "D:/Program Files/nginx-1.20.2/html"; |
| | | String url = "https://mxcd.zhinenganguan.com?No=" + code; |
| | | String filePath = fileUploadConfig.getLocation(); |
| | | QRCodeUtils.encode(url, filePath); |
| | | FileInputStream inputStream = new FileInputStream(filePath); |
| | | ServletOutputStream out = response.getOutputStream(); |