| | |
| | | import com.ruoyi.chargingPile.dto.ChargingGunCountMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingGunMonitoring; |
| | | import com.ruoyi.chargingPile.dto.GetChargingGunMonitoring; |
| | | import com.ruoyi.chargingPile.dto.ChargingPileImportDTO; |
| | | import com.ruoyi.chargingPile.dto.ChargingPileImportResultDTO; |
| | | import com.ruoyi.chargingPile.export.ChargingPileExport; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TChargingGunService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | return chargingPileService.addChargingPile(chargingPile); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/export", "/chargingPile"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PutMapping("/export") |
| | | @Log(title = "??????????????", businessType = BusinessType.EXPORT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "???????", tags = {"????-?????"}) |
| | | public void export(@RequestBody PageChargingPileList page, HttpServletResponse response){ |
| | | List<PageChargingPileListDTO> records = chargingPileService.listChargingPileForExport(page); |
| | | List<ChargingPileExport> exports = records.stream().map(record -> { |
| | | ChargingPileExport export = new ChargingPileExport(); |
| | | BeanUtils.copyProperties(record, export); |
| | | return export; |
| | | }).collect(Collectors.toList()); |
| | | ExcelUtil<ChargingPileExport> util = new ExcelUtil<>(ChargingPileExport.class); |
| | | util.exportExcel(response, exports, "?????"); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @GetMapping("/importTemplate") |
| | | @ApiOperation(value = "?????????", tags = {"????-?????"}) |
| | | public void importTemplate(HttpServletResponse response){ |
| | | ExcelUtil<ChargingPileImportDTO> util = new ExcelUtil<>(ChargingPileImportDTO.class); |
| | | util.importTemplateExcel(response, "???????"); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/add"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping("/import") |
| | | @Log(title = "??????????????", businessType = BusinessType.IMPORT,operatorType = OperatorType.MANAGE) |
| | | @ApiOperation(value = "???????", tags = {"????-?????"}) |
| | | public AjaxResult importChargingPile(@RequestParam("file") MultipartFile file, |
| | | @RequestParam(value = "cover", defaultValue = "false") Boolean cover) throws Exception{ |
| | | ChargingPileImportResultDTO result = chargingPileService.importChargingPile(file, cover); |
| | | if(Boolean.TRUE.equals(result.getNeedConfirm())){ |
| | | return AjaxResult.warn("????????????", result); |
| | | } |
| | | if(result.getErrorCount() != null && result.getErrorCount() > 0){ |
| | | return AjaxResult.error("????????????", result); |
| | | } |
| | | return AjaxResult.success("????", result); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/chargingPile/select", "/chargingPile/update"}, logical = Logical.OR) |
| | | @ResponseBody |