|
|
@@ -1,9 +1,12 @@
|
|
|
package com.zsElectric.boot.business.controller;
|
|
|
|
|
|
+import cn.idev.excel.EasyExcel;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.zsElectric.boot.business.model.query.ThirdPartyStationInfoQuery;
|
|
|
import com.zsElectric.boot.business.model.query.ThirdPartyEquipmentInfoQuery;
|
|
|
import com.zsElectric.boot.business.model.dto.StationDetailDTO;
|
|
|
+import com.zsElectric.boot.business.model.dto.ThirdPartyEquipmentExportDTO;
|
|
|
+import com.zsElectric.boot.business.model.dto.ConnectorTipsUpdateDTO;
|
|
|
import com.zsElectric.boot.business.model.vo.PartyStationInfoVO;
|
|
|
import com.zsElectric.boot.business.model.vo.ThirdPartyStationInfoVO;
|
|
|
import com.zsElectric.boot.business.model.vo.ThirdPartyEquipmentInfoVO;
|
|
|
@@ -15,6 +18,7 @@ import com.zsElectric.boot.core.web.PageResult;
|
|
|
import com.zsElectric.boot.core.web.Result;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.Valid;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
@@ -24,6 +28,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
+import java.net.URLEncoder;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -72,4 +79,25 @@ public class ThirdPartyChargingController {
|
|
|
return Result.success(result);
|
|
|
}
|
|
|
|
|
|
+ @Operation(summary = "导出充电桩信息")
|
|
|
+ @GetMapping("/equipments/export")
|
|
|
+ @Log(value = "导出充电桩信息", module = LogModuleEnum.OTHER)
|
|
|
+ public void exportEquipments(ThirdPartyEquipmentInfoQuery queryParams, HttpServletResponse response) throws IOException {
|
|
|
+ String fileName = "充电桩信息.xlsx";
|
|
|
+ response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
+ response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, StandardCharsets.UTF_8));
|
|
|
+
|
|
|
+ List<ThirdPartyEquipmentExportDTO> exportList = chargingService.listExportEquipments(queryParams);
|
|
|
+ EasyExcel.write(response.getOutputStream(), ThirdPartyEquipmentExportDTO.class).sheet("充电桩信息")
|
|
|
+ .doWrite(exportList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "修改充电桩提示语", description = "支持单个修改、批量修改、按站点一键修改")
|
|
|
+ @PostMapping("/equipments/tips/update")
|
|
|
+ @Log(value = "修改充电桩提示语", module = LogModuleEnum.OTHER)
|
|
|
+ public Result<Integer> updateConnectorTips(@Valid @RequestBody ConnectorTipsUpdateDTO dto) {
|
|
|
+ int count = chargingService.updateConnectorTips(dto);
|
|
|
+ return Result.success(count);
|
|
|
+ }
|
|
|
+
|
|
|
}
|