|
@@ -2,7 +2,8 @@ package com.jiayue.biz.controller;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.jiayue.biz.domain.*;
|
|
|
+import com.jiayue.biz.domain.FanTower;
|
|
|
+import com.jiayue.biz.domain.StationInfo;
|
|
|
import com.jiayue.biz.dto.StationInfoDto;
|
|
|
import com.jiayue.biz.service.ElectricStationService;
|
|
|
import com.jiayue.biz.service.StationInfoService;
|
|
@@ -12,7 +13,6 @@ import com.jiayue.common.core.domain.AjaxResult;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@@ -21,7 +21,6 @@ import java.io.IOException;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/dataQuery/electricStation")
|
|
@@ -34,28 +33,28 @@ public class ElectricStationController extends BaseController {
|
|
|
private final StationInfoService stationInfoService;
|
|
|
|
|
|
@GetMapping("/selectElectricStation")
|
|
|
- public AjaxResult selectElectricStation(){
|
|
|
+ public AjaxResult selectElectricStation() {
|
|
|
return AjaxResult.success(stationInfoService.selectStationInfoDto());
|
|
|
}
|
|
|
|
|
|
|
|
|
@DeleteMapping
|
|
|
- public AjaxResult delElectricStation(@RequestBody StationInfoDto stationInfoDto){
|
|
|
+ public AjaxResult delElectricStation(@RequestBody StationInfoDto stationInfoDto) {
|
|
|
stationInfoService.delStationInfo(stationInfoDto);
|
|
|
- return AjaxResult.success("200") ;
|
|
|
+ return AjaxResult.success("200");
|
|
|
}
|
|
|
|
|
|
@PutMapping
|
|
|
- public AjaxResult updateElectricStation(@RequestBody StationInfoDto stationInfoDto){
|
|
|
+ public AjaxResult updateElectricStation(@RequestBody StationInfoDto stationInfoDto) {
|
|
|
stationInfoService.updateStationInfo(stationInfoDto);
|
|
|
- return AjaxResult.success("200") ;
|
|
|
+ return AjaxResult.success("200");
|
|
|
}
|
|
|
|
|
|
|
|
|
@PostMapping
|
|
|
- public AjaxResult saveElectricStation(@RequestBody StationInfoDto stationInfoDto){
|
|
|
+ public AjaxResult saveElectricStation(@RequestBody StationInfoDto stationInfoDto) {
|
|
|
stationInfoService.saveStationInfo(stationInfoDto);
|
|
|
- return AjaxResult.success("200") ;
|
|
|
+ return AjaxResult.success("200");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -90,8 +89,8 @@ public class ElectricStationController extends BaseController {
|
|
|
return success("读取文件内容为空");
|
|
|
}
|
|
|
|
|
|
- String stationCode = fileStrList.get(0).split(" ")[1];
|
|
|
- if(!stationId.equals(stationCode)){
|
|
|
+ String stationCode = fileStrList.get(0).split("\t")[1];
|
|
|
+ if (!stationId.equals(stationCode)) {
|
|
|
return error("读取文件内容不正确,填写的场站ID:" + stationCode + ",与选择的场站编号不符合");
|
|
|
}
|
|
|
StationInfo stationInfo = stationInfoService.getOneStationInfoByCode(stationCode);
|
|
@@ -99,14 +98,14 @@ public class ElectricStationController extends BaseController {
|
|
|
String fjTypeStr = fileStrList.get(1);
|
|
|
if (fjTypeStr.startsWith("fengji")) {
|
|
|
log.info("上传文件风机型号信息:{}", fjTypeStr);
|
|
|
- String fjType = fjTypeStr.substring(6);
|
|
|
+ String fjType = fjTypeStr.split("\t")[1];
|
|
|
log.info("上传文件风机型号:{}", fjType);
|
|
|
List<FanTower> fanTowerList = new ArrayList<>();
|
|
|
for (int i = 2; i < fileStrList.size(); i++) {
|
|
|
String fjStr = fileStrList.get(i);
|
|
|
if (StrUtil.isNotBlank(fjStr)) {
|
|
|
- if(fjStr.startsWith("fengji")){
|
|
|
- fjType = fjStr.split(" ")[1];
|
|
|
+ if (fjStr.startsWith("fengji")) {
|
|
|
+ fjType = fjStr.split("\t")[1];
|
|
|
continue;
|
|
|
}
|
|
|
String[] fjStrArr = fjStr.split("\t");
|