Compare commits
No commits in common. "9a6cff1514d484e11fc6db0f4f31b41902496d46" and "1a110afcf8a87106b76c194431c77e8bb5b0be69" have entirely different histories.
9a6cff1514
...
1a110afcf8
@ -10,12 +10,14 @@ import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeService;
|
|||||||
import com.yfd.platform.utils.SecurityUtils;
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -47,10 +49,9 @@ public class AlgorithmArrangeController {
|
|||||||
Page<AlgorithmArrange> arrangePage = algorithmArrangeService.page(page, queryWrapper);
|
Page<AlgorithmArrange> arrangePage = algorithmArrangeService.page(page, queryWrapper);
|
||||||
return ResponseResult.successData(arrangePage);
|
return ResponseResult.successData(arrangePage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getAlgorithmArrangeById")
|
@GetMapping("/getAlgorithmArrangeById")
|
||||||
@ApiOperation("根据Id查询算法布点")
|
@ApiOperation("根据Id查询算法布点")
|
||||||
public ResponseResult getAlgorithmArrangeById(String id) {
|
public ResponseResult getAlgorithmArrangeById (String id){
|
||||||
AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id);
|
AlgorithmArrange algorithmArrange = algorithmArrangeService.getById(id);
|
||||||
return ResponseResult.successData(algorithmArrange);
|
return ResponseResult.successData(algorithmArrange);
|
||||||
}
|
}
|
||||||
@ -58,13 +59,6 @@ public class AlgorithmArrangeController {
|
|||||||
@PostMapping("/saveAlgorithmArrange")
|
@PostMapping("/saveAlgorithmArrange")
|
||||||
@ApiOperation("新增算法布点")
|
@ApiOperation("新增算法布点")
|
||||||
public ResponseResult saveAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) {
|
public ResponseResult saveAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) {
|
||||||
|
|
||||||
// 判断是否存在相同的方案
|
|
||||||
LambdaQueryWrapper<AlgorithmArrange> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(AlgorithmArrange::getArrangeName, algorithmArrange.getArrangeName());
|
|
||||||
if (algorithmArrangeService.getOne(queryWrapper) != null) {
|
|
||||||
return ResponseResult.error("方案名称已存在");
|
|
||||||
}
|
|
||||||
algorithmArrange.setLastmodifier("admin");
|
algorithmArrange.setLastmodifier("admin");
|
||||||
algorithmArrange.setLastmodifydate(LocalDateTime.now());
|
algorithmArrange.setLastmodifydate(LocalDateTime.now());
|
||||||
algorithmArrange.setDatastatus("1");
|
algorithmArrange.setDatastatus("1");
|
||||||
@ -91,13 +85,6 @@ public class AlgorithmArrangeController {
|
|||||||
@PostMapping("/updateAlgorithmArrange")
|
@PostMapping("/updateAlgorithmArrange")
|
||||||
@ApiOperation("修改算法布点")
|
@ApiOperation("修改算法布点")
|
||||||
public ResponseResult updateAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) {
|
public ResponseResult updateAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) {
|
||||||
// 判断是否存在相同的方案
|
|
||||||
LambdaQueryWrapper<AlgorithmArrange> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.ne(AlgorithmArrange::getId, algorithmArrange.getId()).eq(AlgorithmArrange::getArrangeName,
|
|
||||||
algorithmArrange.getArrangeName());
|
|
||||||
if (algorithmArrangeService.getOne(queryWrapper) != null) {
|
|
||||||
return ResponseResult.error("方案名称已存在");
|
|
||||||
}
|
|
||||||
algorithmArrange.setLastmodifier(SecurityUtils.getCurrentUsername());
|
algorithmArrange.setLastmodifier(SecurityUtils.getCurrentUsername());
|
||||||
algorithmArrange.setLastmodifydate(LocalDateTime.now());
|
algorithmArrange.setLastmodifydate(LocalDateTime.now());
|
||||||
// 文件上传逻辑
|
// 文件上传逻辑
|
||||||
@ -118,33 +105,12 @@ public class AlgorithmArrangeController {
|
|||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/deleteAlgorithmArrange")
|
|
||||||
@ApiOperation("删除布点数据")
|
|
||||||
public ResponseResult deleteAlgorithmArrange(String id) {
|
|
||||||
boolean b = algorithmArrangeService.removeById(id);
|
|
||||||
if (b) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/deleteAlgorithmArrange")
|
|
||||||
@ApiOperation("删除布点数据")
|
|
||||||
public ResponseResult deleteAlgorithmArrange(@RequestBody List<String> ids) {
|
|
||||||
boolean b = algorithmArrangeService.removeByIds(ids);
|
|
||||||
if (b) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/callAlgorithmArrange")
|
@PostMapping("/callAlgorithmArrange")
|
||||||
@ApiOperation("调用算法布点API")
|
@ApiOperation("调用算法布点API")
|
||||||
public ResponseResult callAlgorithmArrange(String id) {
|
public ResponseResult callAlgorithmArrange(String id) {
|
||||||
AlgorithmArrange algorithmArrange = algorithmArrangeService.callAlgorithmArrange(id);
|
AlgorithmArrange algorithmArrange=algorithmArrangeService.callAlgorithmArrange(id);
|
||||||
return ResponseResult.successData(algorithmArrange);
|
return ResponseResult.successData(algorithmArrange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package com.yfd.platform.modules.algorithm.controller;
|
package com.yfd.platform.modules.algorithm.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmArrangeDevice;
|
|
||||||
import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeDeviceService;
|
import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeDeviceService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@ -36,13 +34,4 @@ public class AlgorithmArrangeDeviceController {
|
|||||||
List<Map<String, Object>> maps = algorithmArrangeDeviceService.getArrangeDeviceInfo(arrangeId);
|
List<Map<String, Object>> maps = algorithmArrangeDeviceService.getArrangeDeviceInfo(arrangeId);
|
||||||
return ResponseResult.successData(maps);
|
return ResponseResult.successData(maps);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getArrangeDeviceById")
|
|
||||||
@ApiOperation("根据ID查询当前布点详情")
|
|
||||||
public ResponseResult getArrangeDeviceById(String arrangeId) {
|
|
||||||
LambdaQueryWrapper<AlgorithmArrangeDevice> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(AlgorithmArrangeDevice::getArrangeId, arrangeId);
|
|
||||||
List<Map<String, Object>> maps = algorithmArrangeDeviceService.listMaps(queryWrapper);
|
|
||||||
return ResponseResult.successData(maps);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ public class SubstationMaindeviceController {
|
|||||||
}
|
}
|
||||||
LambdaQueryWrapper<SubstationMaindevice> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SubstationMaindevice> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(StrUtil.isNotBlank(stationCode), SubstationMaindevice::getStationCode, stationCode);
|
queryWrapper.eq(StrUtil.isNotBlank(stationCode), SubstationMaindevice::getStationCode, stationCode);
|
||||||
queryWrapper.in(StrUtil.isNotBlank(deviceTypeList), SubstationMaindevice::getDeviceType, StrUtil.split(deviceTypeList
|
queryWrapper.eq(StrUtil.isNotBlank(deviceTypeList), SubstationMaindevice::getDeviceType, StrUtil.split(deviceTypeList
|
||||||
, ","));
|
, ","));
|
||||||
queryWrapper.select(SubstationMaindevice::getMainDeviceId, SubstationMaindevice::getMainDeviceName,
|
queryWrapper.select(SubstationMaindevice::getMainDeviceId, SubstationMaindevice::getMainDeviceName,
|
||||||
SubstationMaindevice::getDeviceType, SubstationMaindevice::getFileUrl);
|
SubstationMaindevice::getDeviceType, SubstationMaindevice::getFileUrl);
|
||||||
|
Loading…
Reference in New Issue
Block a user