feat:增加api注解,新增监测器判断台站信息是否为空
This commit is contained in:
parent
0ae9a54f98
commit
5d29eea31e
|
@ -1,6 +1,8 @@
|
|||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.GardsDetectors;
|
||||
|
@ -10,36 +12,42 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("gardsDetectors")
|
||||
@Api("监测器管理")
|
||||
public class GardsDetectorsController {
|
||||
|
||||
@Autowired
|
||||
private IGardsDetectorsService gardsDetectorsService;
|
||||
|
||||
@GetMapping("findPage")
|
||||
@ApiOperation(value = "分页查询监测器")
|
||||
public Result<IPage<GardsDetectors>> findPage(QueryRequest queryRequest, GardsDetectors gardsDetectors){
|
||||
Result<IPage<GardsDetectors>> result = gardsDetectorsService.findPage(queryRequest, gardsDetectors);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("findInfo")
|
||||
@ApiOperation(value = "查询监测器详情信息")
|
||||
public GardsDetectors findInfo(Integer id){
|
||||
GardsDetectors result = gardsDetectorsService.findInfo(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("create")
|
||||
@ApiOperation(value = "新增监测器信息")
|
||||
public Result create(@RequestBody GardsDetectors gardsDetectors){
|
||||
Result result = gardsDetectorsService.create(gardsDetectors);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation(value = "修改监测器信息")
|
||||
public Result update(@RequestBody GardsDetectors gardsDetectors){
|
||||
Result result = gardsDetectorsService.update(gardsDetectors);
|
||||
return result;
|
||||
}
|
||||
|
||||
@DeleteMapping("deleteById")
|
||||
@ApiOperation(value = "删除监测器信息")
|
||||
public Result deleteById(Integer id){
|
||||
Result result = gardsDetectorsService.deleteById(id);
|
||||
return result;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.GardsNuclearfacility;
|
||||
|
@ -10,36 +12,42 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("gardsNuclearfacility")
|
||||
@Api("核设施管理")
|
||||
public class GardsNuclearfacilityController {
|
||||
|
||||
@Autowired
|
||||
private IGardsNuclearfacilityService gardsNuclearfacilityService;
|
||||
|
||||
@GetMapping("findPage")
|
||||
@ApiOperation(value = "分页查询核设施信息")
|
||||
public Result<IPage<GardsNuclearfacility>> findPage(QueryRequest queryRequest, GardsNuclearfacility gardsNuclearfacility){
|
||||
Result<IPage<GardsNuclearfacility>> result = gardsNuclearfacilityService.findPage(queryRequest, gardsNuclearfacility);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("findInfo")
|
||||
@ApiOperation(value = "查询核设施详情信息")
|
||||
public GardsNuclearfacility findInfo(Integer id){
|
||||
GardsNuclearfacility result = gardsNuclearfacilityService.findInfo(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("create")
|
||||
@ApiOperation(value = "新增核设施信息")
|
||||
public Result create(@RequestBody GardsNuclearfacility gardsNuclearfacility){
|
||||
Result result = gardsNuclearfacilityService.create(gardsNuclearfacility);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation(value = "修改核设施信息")
|
||||
public Result update(@RequestBody GardsNuclearfacility gardsNuclearfacility){
|
||||
Result result = gardsNuclearfacilityService.update(gardsNuclearfacility);
|
||||
return result;
|
||||
}
|
||||
|
||||
@DeleteMapping("deleteById")
|
||||
@ApiOperation(value = "删除核设施信息")
|
||||
public Result deleteById(Integer id){
|
||||
Result result = gardsNuclearfacilityService.deleteById(id);
|
||||
return result;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.GardsSelfbuiltStations;
|
||||
|
@ -10,36 +12,42 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("gardsSelfbuilt")
|
||||
@Api("自建台站管理")
|
||||
public class GardsSelfbuiltController {
|
||||
|
||||
@Autowired
|
||||
private IGardsSelfbuiltService gardsSelfbuiltService;
|
||||
|
||||
@GetMapping("findPage")
|
||||
@ApiOperation("分页查询自建台站信息")
|
||||
public Result<IPage<GardsSelfbuiltStations>> findPage(QueryRequest queryRequest, GardsSelfbuiltStations gardsSelfbuiltStations){
|
||||
Result<IPage<GardsSelfbuiltStations>> result = gardsSelfbuiltService.findPage(queryRequest, gardsSelfbuiltStations);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("findInfo")
|
||||
@ApiOperation("查询自建台站详情信息")
|
||||
public GardsSelfbuiltStations findInfo(Integer id){
|
||||
GardsSelfbuiltStations info = gardsSelfbuiltService.findInfo(id);
|
||||
return info;
|
||||
}
|
||||
|
||||
@PostMapping("create")
|
||||
@ApiOperation("新增自建台站信息")
|
||||
public Result create(@RequestBody GardsSelfbuiltStations gardsSelfbuiltStations){
|
||||
Result result = gardsSelfbuiltService.create(gardsSelfbuiltStations);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("修改自建台站信息")
|
||||
public Result update(@RequestBody GardsSelfbuiltStations gardsSelfbuiltStations){
|
||||
Result result = gardsSelfbuiltService.update(gardsSelfbuiltStations);
|
||||
return result;
|
||||
}
|
||||
|
||||
@DeleteMapping("deleteById")
|
||||
@ApiOperation("删除自建台站信息")
|
||||
public Result deleteById(Integer id){
|
||||
Result result = gardsSelfbuiltService.deleteById(id);
|
||||
return result;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.jeecg.modules.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.system.entity.GardsStations;
|
||||
|
@ -10,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("gardsStations")
|
||||
@Api("台站管理")
|
||||
public class GardsStationsController {
|
||||
|
||||
@Autowired
|
||||
|
@ -22,6 +25,7 @@ public class GardsStationsController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("findPage")
|
||||
@ApiOperation("分页查询台站管理信息")
|
||||
public Result<IPage<GardsStations>> findPage(QueryRequest queryRequest, GardsStations gardsStations){
|
||||
Result<IPage<GardsStations>> result = gardsStationsService.findPage(queryRequest, gardsStations);
|
||||
return result;
|
||||
|
@ -33,6 +37,7 @@ public class GardsStationsController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("findInfo")
|
||||
@ApiOperation("查询台站管理详情信息")
|
||||
public GardsStations findInfo(Integer stationId){
|
||||
GardsStations result = gardsStationsService.findInfo(stationId);
|
||||
return result;
|
||||
|
@ -42,6 +47,7 @@ public class GardsStationsController {
|
|||
* 新增台站信息接口
|
||||
*/
|
||||
@PostMapping("create")
|
||||
@ApiOperation("新增台站管理信息")
|
||||
public Result create(@RequestBody GardsStations gardsStations){
|
||||
Result result = gardsStationsService.create(gardsStations);
|
||||
return result;
|
||||
|
@ -51,6 +57,7 @@ public class GardsStationsController {
|
|||
* 修改台站信息接口
|
||||
*/
|
||||
@PutMapping("update")
|
||||
@ApiOperation("修改台站管理信息")
|
||||
public Result update(@RequestBody GardsStations gardsStations){
|
||||
Result result = gardsStationsService.update(gardsStations);
|
||||
return result;
|
||||
|
@ -61,6 +68,7 @@ public class GardsStationsController {
|
|||
* @param stationId
|
||||
*/
|
||||
@DeleteMapping("deleteById")
|
||||
@ApiOperation("删除台站管理信息")
|
||||
public Result deleteById(Integer stationId){
|
||||
Result result = gardsStationsService.deleteById(stationId);
|
||||
return result;
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.system.service.impl;
|
|||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
@ -36,11 +37,13 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
|
|||
LambdaQueryWrapper<GardsDetectors> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Page<GardsDetectors> detectorsPage = this.baseMapper.selectPage(page, queryWrapper);
|
||||
detectorsPage.getRecords().forEach(item->{
|
||||
if (CollectionUtils.isNotEmpty(gardsStations)) {
|
||||
for (GardsStations gardsStation:gardsStations) {
|
||||
if (gardsStation.getStationId().equals(item.getStationId())){
|
||||
item.setStationName(gardsStation.getStationCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
result.setSuccess(true);
|
||||
result.setResult(detectorsPage);
|
||||
|
@ -57,11 +60,13 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
|
|||
if (Objects.isNull(gardsDetectors)) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(gardsStations)){
|
||||
for (GardsStations gardsStation:gardsStations) {
|
||||
if (gardsStation.getStationId().equals(gardsDetectors.getStationId())) {
|
||||
gardsDetectors.setStationName(gardsStation.getStationCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
return gardsDetectors;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user