修改监测综合信息库查询为模糊查询
This commit is contained in:
parent
989710266b
commit
b2a591e366
|
|
@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.modules.base.entity.SourceRebuildMonitoringData;
|
import org.jeecg.modules.base.entity.SourceRebuildMonitoringData;
|
||||||
|
|
@ -44,17 +45,7 @@ public class GardsAcceleratorController {
|
||||||
@Operation(summary = "新增加速器信息")
|
@Operation(summary = "新增加速器信息")
|
||||||
@PostMapping("create")
|
@PostMapping("create")
|
||||||
public Result<?> create(@RequestBody GardsAccelerator gardsAccelerator) {
|
public Result<?> create(@RequestBody GardsAccelerator gardsAccelerator) {
|
||||||
try {
|
return gardsAcceleratorService.create(gardsAccelerator);
|
||||||
boolean success = gardsAcceleratorService.save(gardsAccelerator);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("添加成功",gardsAccelerator);
|
|
||||||
} else {
|
|
||||||
return Result.error("设施信息添加失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -64,17 +55,7 @@ public class GardsAcceleratorController {
|
||||||
@Operation(summary = "删除加速器信息")
|
@Operation(summary = "删除加速器信息")
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
public Result<?> delete(@RequestParam Integer id) {
|
public Result<?> delete(@RequestParam Integer id) {
|
||||||
try {
|
return gardsAcceleratorService.delete(id);
|
||||||
boolean success = gardsAcceleratorService.removeById(id);
|
|
||||||
if (success) {
|
|
||||||
return Result.ok("删除成功");
|
|
||||||
} else {
|
|
||||||
return Result.error("设施信息删除失败,可能该记录不存在");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -83,17 +64,8 @@ public class GardsAcceleratorController {
|
||||||
@Operation(summary = "更新加速器信息")
|
@Operation(summary = "更新加速器信息")
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
public Result<?> update(@RequestBody GardsAccelerator gardsAccelerator) {
|
public Result<?> update(@RequestBody GardsAccelerator gardsAccelerator) {
|
||||||
try {
|
return gardsAcceleratorService.update(gardsAccelerator);
|
||||||
boolean success = gardsAcceleratorService.updateById(gardsAccelerator);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("设施信息更新成功",gardsAccelerator);
|
|
||||||
} else {
|
|
||||||
return Result.error("设施信息更新失败,可能该记录不存在");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -102,17 +74,7 @@ public class GardsAcceleratorController {
|
||||||
@Operation(summary = "查询加速器信息")
|
@Operation(summary = "查询加速器信息")
|
||||||
@GetMapping("/queryById")
|
@GetMapping("/queryById")
|
||||||
public Result<GardsAccelerator> getById(@RequestParam Integer id) {
|
public Result<GardsAccelerator> getById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsAcceleratorService.queryById(id);
|
||||||
GardsAccelerator facility = gardsAcceleratorService.getById(id);
|
|
||||||
if (facility != null) {
|
|
||||||
return Result.ok(facility);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到对应的设施信息");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -123,120 +85,109 @@ public class GardsAcceleratorController {
|
||||||
public Result<IPage<GardsAccelerator>> page(
|
public Result<IPage<GardsAccelerator>> page(
|
||||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
@RequestParam(required = false) String country,
|
@RequestParam(required = false) String country,
|
||||||
@RequestParam(required = false) String facilityName
|
@RequestParam(required = false) String facilityName
|
||||||
) {
|
) {
|
||||||
try {
|
return gardsAcceleratorService.queryPage(pageNum, pageSize, country, facilityName);
|
||||||
Page<GardsAccelerator> page = new Page<>(pageNum, pageSize);
|
|
||||||
LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsAccelerator::getFacilityName, facilityName);
|
|
||||||
}
|
|
||||||
if (country != null && !country.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsAccelerator::getCountry, country);
|
|
||||||
}
|
|
||||||
IPage<GardsAccelerator> pageResult = gardsAcceleratorService.page(page,wrapper);
|
|
||||||
return Result.ok(pageResult);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("分页查询失败: " + e.getMessage());
|
|
||||||
return Result.error("分页查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//region 注释代码
|
||||||
* 查询所有设施列表
|
//
|
||||||
*/
|
// /**
|
||||||
@Operation(summary = "查询加速器所有信息")
|
// * 查询所有设施列表
|
||||||
@GetMapping("/list")
|
// */
|
||||||
public Result<List<GardsAccelerator>> list() {
|
// @Operation(summary = "查询加速器所有信息")
|
||||||
try {
|
// @GetMapping("/list")
|
||||||
List<GardsAccelerator> list = gardsAcceleratorService.list();
|
// public Result<List<GardsAccelerator>> list() {
|
||||||
return Result.ok(list);
|
// try {
|
||||||
} catch (Exception e) {
|
// List<GardsAccelerator> list = gardsAcceleratorService.list();
|
||||||
log.error("查询失败: " + e.getMessage());
|
// return Result.ok(list);
|
||||||
return Result.error("查询失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 根据设施代码查询
|
||||||
|
// */
|
||||||
|
// @Operation(summary = "根据加速器代码查询")
|
||||||
|
// @GetMapping("/by-facility-code")
|
||||||
|
// public Result<GardsAccelerator> getByFacilityCode(@RequestParam String facilityCode) {
|
||||||
|
// try {
|
||||||
|
// GardsAccelerator facility = gardsAcceleratorService.getByFacilityCode(facilityCode);
|
||||||
|
// if (facility != null) {
|
||||||
|
// return Result.ok(facility);
|
||||||
|
// } else {
|
||||||
|
// return Result.error("未找到设施代码为 " + facilityCode + " 的设施");
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("查询失败: " + e.getMessage());
|
||||||
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 根据国家查询
|
||||||
|
// */
|
||||||
|
// @Operation(summary = "根据加速器国家查询")
|
||||||
|
// @GetMapping("/by-country")
|
||||||
|
// public Result<List<GardsAccelerator>> getByCountry(@RequestParam String country) {
|
||||||
|
// try {
|
||||||
|
// List<GardsAccelerator> list = gardsAcceleratorService.getByCountry(country);
|
||||||
|
// return Result.ok(list);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("查询失败: " + e.getMessage());
|
||||||
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 根据运行状态查询
|
||||||
|
// */
|
||||||
|
// @Operation(summary = "根据加速器运行状态查询")
|
||||||
|
// @GetMapping("/by-status")
|
||||||
|
// public Result<List<GardsAccelerator>> getByOperationalStatus(@RequestParam Integer isOperational) {
|
||||||
|
// try {
|
||||||
|
// List<GardsAccelerator> list = gardsAcceleratorService.getByOperationalStatus(isOperational);
|
||||||
|
// return Result.ok(list);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("查询失败: " + e.getMessage());
|
||||||
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 条件组合查询
|
||||||
|
// */
|
||||||
|
// @GetMapping("/search")
|
||||||
|
// @Operation(summary = "条件组合查询")
|
||||||
|
// public Result<List<GardsAccelerator>> search(
|
||||||
|
// @RequestParam(required = false) String country,
|
||||||
|
// @RequestParam(required = false) String category,
|
||||||
|
// @RequestParam(required = false) Integer isOperational) {
|
||||||
|
// try {
|
||||||
|
// LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
//
|
||||||
|
// if (country != null && !country.isEmpty()) {
|
||||||
|
// wrapper.eq(GardsAccelerator::getCountry, country);
|
||||||
|
// }
|
||||||
|
// if (category != null && !category.isEmpty()) {
|
||||||
|
// wrapper.eq(GardsAccelerator::getCategory, category);
|
||||||
|
// }
|
||||||
|
// if (isOperational != null) {
|
||||||
|
// wrapper.eq(GardsAccelerator::getIsOperational, isOperational);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<GardsAccelerator> list = gardsAcceleratorService.list(wrapper);
|
||||||
|
// return Result.ok(list);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("条件查询失败: " + e.getMessage());
|
||||||
|
// return Result.error("条件查询失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
//endregion
|
||||||
* 根据设施代码查询
|
|
||||||
*/
|
|
||||||
@Operation(summary = "根据加速器代码查询")
|
|
||||||
@GetMapping("/by-facility-code")
|
|
||||||
public Result<GardsAccelerator> getByFacilityCode(@RequestParam String facilityCode) {
|
|
||||||
try {
|
|
||||||
GardsAccelerator facility = gardsAcceleratorService.getByFacilityCode(facilityCode);
|
|
||||||
if (facility != null) {
|
|
||||||
return Result.ok(facility);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到设施代码为 " + facilityCode + " 的设施");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("查询失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据国家查询
|
|
||||||
*/
|
|
||||||
@Operation(summary = "根据加速器国家查询")
|
|
||||||
@GetMapping("/by-country")
|
|
||||||
public Result<List<GardsAccelerator>> getByCountry(@RequestParam String country) {
|
|
||||||
try {
|
|
||||||
List<GardsAccelerator> list = gardsAcceleratorService.getByCountry(country);
|
|
||||||
return Result.ok(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("查询失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据运行状态查询
|
|
||||||
*/
|
|
||||||
@Operation(summary = "根据加速器运行状态查询")
|
|
||||||
@GetMapping("/by-status")
|
|
||||||
public Result<List<GardsAccelerator>> getByOperationalStatus(@RequestParam Integer isOperational) {
|
|
||||||
try {
|
|
||||||
List<GardsAccelerator> list = gardsAcceleratorService.getByOperationalStatus(isOperational);
|
|
||||||
return Result.ok(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("查询失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 条件组合查询
|
|
||||||
*/
|
|
||||||
@GetMapping("/search")
|
|
||||||
@Operation(summary = "条件组合查询")
|
|
||||||
public Result<List<GardsAccelerator>> search(
|
|
||||||
@RequestParam(required = false) String country,
|
|
||||||
@RequestParam(required = false) String category,
|
|
||||||
@RequestParam(required = false) Integer isOperational) {
|
|
||||||
try {
|
|
||||||
LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (country != null && !country.isEmpty()) {
|
|
||||||
wrapper.eq(GardsAccelerator::getCountry, country);
|
|
||||||
}
|
|
||||||
if (category != null && !category.isEmpty()) {
|
|
||||||
wrapper.eq(GardsAccelerator::getCategory, category);
|
|
||||||
}
|
|
||||||
if (isOperational != null) {
|
|
||||||
wrapper.eq(GardsAccelerator::getIsOperational, isOperational);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<GardsAccelerator> list = gardsAcceleratorService.list(wrapper);
|
|
||||||
return Result.ok(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("条件查询失败: " + e.getMessage());
|
|
||||||
return Result.error("条件查询失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "导出模版")
|
@AutoLog(value = "导出模版")
|
||||||
@Operation(summary = "加速器信息导出模版")
|
@Operation(summary = "加速器信息导出模版")
|
||||||
|
|
@ -265,15 +216,17 @@ public class GardsAcceleratorController {
|
||||||
|
|
||||||
LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (country != null && !country.isEmpty()) {
|
if (StringUtils.isNotBlank(country)) {
|
||||||
wrapper.eq(GardsAccelerator::getCountry, country);
|
wrapper.like(GardsAccelerator::getCountry, country);
|
||||||
}
|
}
|
||||||
if (category != null && !category.isEmpty()) {
|
// if (category != null && !category.isEmpty()) {
|
||||||
wrapper.eq(GardsAccelerator::getCategory, category);
|
// wrapper.eq(GardsAccelerator::getCategory, category);
|
||||||
}
|
// }
|
||||||
if (facilityName != null && !facilityName.isEmpty()) {
|
if (StringUtils.isNotBlank(facilityName)) {
|
||||||
wrapper.eq(GardsAccelerator::getFacilityName, facilityName);
|
wrapper.like(GardsAccelerator::getFacilityName, facilityName);
|
||||||
}
|
}
|
||||||
|
wrapper.orderByDesc(GardsAccelerator::getId);
|
||||||
|
|
||||||
List<GardsAccelerator> list = gardsAcceleratorService.list(wrapper);
|
List<GardsAccelerator> list = gardsAcceleratorService.list(wrapper);
|
||||||
ExcelExportUtil.exportExcel(params, GardsAccelerator.class, list).write(response.getOutputStream());
|
ExcelExportUtil.exportExcel(params, GardsAccelerator.class, list).write(response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,7 @@ public class GardsCorrectionFactorController {
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "新增校正因子")
|
@Operation(summary = "新增校正因子")
|
||||||
public Result<?> create(@RequestBody GardsCorrectionFactor gardsCorrectionFactor) {
|
public Result<?> create(@RequestBody GardsCorrectionFactor gardsCorrectionFactor) {
|
||||||
try {
|
return gardsCorrectionFactorService.create(gardsCorrectionFactor);
|
||||||
boolean success = gardsCorrectionFactorService.save(gardsCorrectionFactor);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("校正因子添加成功", gardsCorrectionFactor);
|
|
||||||
} else {
|
|
||||||
return Result.error("校正因子添加失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,17 +51,7 @@ public class GardsCorrectionFactorController {
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "根据ID删除校正因子")
|
@Operation(summary = "根据ID删除校正因子")
|
||||||
public Result<?> delete(@RequestParam(name="id") Integer id) {
|
public Result<?> delete(@RequestParam(name="id") Integer id) {
|
||||||
try {
|
return gardsCorrectionFactorService.delete(id);
|
||||||
boolean success = gardsCorrectionFactorService.removeById(id);
|
|
||||||
if (success) {
|
|
||||||
return Result.ok("校正因子删除成功");
|
|
||||||
} else {
|
|
||||||
return Result.error("校正因子删除失败,可能该记录不存在");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,17 +60,7 @@ public class GardsCorrectionFactorController {
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新校正因子信息")
|
@Operation(summary = "更新校正因子信息")
|
||||||
public Result<?> update(@RequestBody GardsCorrectionFactor gardsCorrectionFactor) {
|
public Result<?> update(@RequestBody GardsCorrectionFactor gardsCorrectionFactor) {
|
||||||
try {
|
return gardsCorrectionFactorService.update(gardsCorrectionFactor);
|
||||||
boolean success = gardsCorrectionFactorService.updateById(gardsCorrectionFactor);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("校正因子更新成功", gardsCorrectionFactor);
|
|
||||||
} else {
|
|
||||||
return Result.error("校正因子更新失败,可能该记录不存在");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -99,17 +69,7 @@ public class GardsCorrectionFactorController {
|
||||||
@GetMapping("/queryById")
|
@GetMapping("/queryById")
|
||||||
@Operation(summary = "根据ID查询校正因子详情")
|
@Operation(summary = "根据ID查询校正因子详情")
|
||||||
public Result<GardsCorrectionFactor> getById(@RequestParam(name="id") Integer id) {
|
public Result<GardsCorrectionFactor> getById(@RequestParam(name="id") Integer id) {
|
||||||
try {
|
return gardsCorrectionFactorService.queryById(id);
|
||||||
GardsCorrectionFactor factor = gardsCorrectionFactorService.getById(id);
|
|
||||||
if (factor != null) {
|
|
||||||
return Result.OK("查询成功", factor);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到对应的校正因子信息");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -122,159 +82,147 @@ public class GardsCorrectionFactorController {
|
||||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
@RequestParam(required = false) String stationCode,
|
@RequestParam(required = false) String stationCode,
|
||||||
@RequestParam(required = false) String detectorCode) {
|
@RequestParam(required = false) String detectorCode) {
|
||||||
try {
|
return gardsCorrectionFactorService.page(pageNum, pageSize, stationCode, detectorCode);
|
||||||
Page<GardsCorrectionFactor> page = new Page<>(pageNum, pageSize);
|
|
||||||
LambdaQueryWrapper<GardsCorrectionFactor> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (stationCode != null && !stationCode.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsCorrectionFactor::getStationCode, stationCode);
|
|
||||||
}
|
|
||||||
if (detectorCode != null && !detectorCode.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsCorrectionFactor::getDetectorCode, detectorCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
IPage<GardsCorrectionFactor> pageResult = gardsCorrectionFactorService.page(page, wrapper);
|
|
||||||
return Result.OK ("分页查询成功", pageResult);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("分页查询失败: " + e.getMessage());
|
|
||||||
return Result.error("分页查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//region 注释代码
|
||||||
* 查询所有校正因子列表
|
//
|
||||||
*/
|
// /**
|
||||||
@GetMapping("/list")
|
// * 查询所有校正因子列表
|
||||||
@Operation(summary = "查询所有校正因子列表")
|
// */
|
||||||
public Result<List<GardsCorrectionFactor>> list() {
|
// @GetMapping("/list")
|
||||||
try {
|
// @Operation(summary = "查询所有校正因子列表")
|
||||||
List<GardsCorrectionFactor> list = gardsCorrectionFactorService.list();
|
// public Result<List<GardsCorrectionFactor>> list() {
|
||||||
return Result.OK ("查询成功", list);
|
// try {
|
||||||
} catch (Exception e) {
|
// List<GardsCorrectionFactor> list = gardsCorrectionFactorService.list();
|
||||||
log.error("查询失败: " + e.getMessage());
|
// return Result.OK ("查询成功", list);
|
||||||
return Result.error("查询失败" );
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("查询失败" );
|
||||||
|
// }
|
||||||
/**
|
// }
|
||||||
* 根据站点代码查询
|
//
|
||||||
*/
|
// /**
|
||||||
@GetMapping("/by-station")
|
// * 根据站点代码查询
|
||||||
@Operation(summary = "根据站点代码查询")
|
// */
|
||||||
public Result<List<GardsCorrectionFactor>> getByStationCode(@RequestParam(name = "stationCode") String stationCode) {
|
// @GetMapping("/by-station")
|
||||||
try {
|
// @Operation(summary = "根据站点代码查询")
|
||||||
List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByStationCode(stationCode);
|
// public Result<List<GardsCorrectionFactor>> getByStationCode(@RequestParam(name = "stationCode") String stationCode) {
|
||||||
return Result.OK ("查询成功", list);
|
// try {
|
||||||
} catch (Exception e) {
|
// List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByStationCode(stationCode);
|
||||||
log.error("查询失败: " + e.getMessage());
|
// return Result.OK ("查询成功", list);
|
||||||
return Result.error("查询失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
/**
|
// }
|
||||||
* 根据探测器代码查询
|
//
|
||||||
*/
|
// /**
|
||||||
@GetMapping("/by-detector")
|
// * 根据探测器代码查询
|
||||||
@Operation(summary = "查询所有校正因子库数据")
|
// */
|
||||||
public Result<List<GardsCorrectionFactor>> getByDetectorCode(@RequestParam(name="detectorCode") String detectorCode) {
|
// @GetMapping("/by-detector")
|
||||||
try {
|
// @Operation(summary = "查询所有校正因子库数据")
|
||||||
List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByDetectorCode(detectorCode);
|
// public Result<List<GardsCorrectionFactor>> getByDetectorCode(@RequestParam(name="detectorCode") String detectorCode) {
|
||||||
return Result.OK ("查询成功", list);
|
// try {
|
||||||
} catch (Exception e) {
|
// List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByDetectorCode(detectorCode);
|
||||||
log.error("查询失败: " + e.getMessage());
|
// return Result.OK ("查询成功", list);
|
||||||
return Result.error("查询失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
/**
|
// }
|
||||||
* 根据站点和探测器代码组合查询
|
//
|
||||||
*/
|
// /**
|
||||||
@GetMapping("/by-station-detector")
|
// * 根据站点和探测器代码组合查询
|
||||||
@Operation(summary = "根据站点和探测器代码组合查询")
|
// */
|
||||||
public Result<List<GardsCorrectionFactor>> getByStationAndDetector(
|
// @GetMapping("/by-station-detector")
|
||||||
@RequestParam String stationCode,
|
// @Operation(summary = "根据站点和探测器代码组合查询")
|
||||||
@RequestParam String detectorCode) {
|
// public Result<List<GardsCorrectionFactor>> getByStationAndDetector(
|
||||||
try {
|
// @RequestParam String stationCode,
|
||||||
List<GardsCorrectionFactor> factor = gardsCorrectionFactorService.getByStationAndDetector(stationCode, detectorCode);
|
// @RequestParam String detectorCode) {
|
||||||
if (factor != null) {
|
// try {
|
||||||
return Result.OK("查询成功", factor);
|
// List<GardsCorrectionFactor> factor = gardsCorrectionFactorService.getByStationAndDetector(stationCode, detectorCode);
|
||||||
} else {
|
// if (factor != null) {
|
||||||
return Result.error("未找到对应的校正因子");
|
// return Result.OK("查询成功", factor);
|
||||||
}
|
// } else {
|
||||||
} catch (Exception e) {
|
// return Result.error("未找到对应的校正因子");
|
||||||
log.error("查询失败: " + e.getMessage());
|
// }
|
||||||
return Result.error("查询失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
/**
|
// }
|
||||||
* 根据制造商查询
|
//
|
||||||
*/
|
// /**
|
||||||
@GetMapping("/by-manufacturer")
|
// * 根据制造商查询
|
||||||
@Operation(summary = "根据制造商查询")
|
// */
|
||||||
public Result<List<GardsCorrectionFactor>> getByManufacturer(@RequestParam String manufacturer) {
|
// @GetMapping("/by-manufacturer")
|
||||||
try {
|
// @Operation(summary = "根据制造商查询")
|
||||||
List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByManufacturer(manufacturer);
|
// public Result<List<GardsCorrectionFactor>> getByManufacturer(@RequestParam String manufacturer) {
|
||||||
return Result.OK("查询成功", list);
|
// try {
|
||||||
} catch (Exception e) {
|
// List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByManufacturer(manufacturer);
|
||||||
log.error("查询失败: " + e.getMessage());
|
// return Result.OK("查询成功", list);
|
||||||
return Result.error("查询失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
/**
|
// }
|
||||||
* 根据型号查询
|
//
|
||||||
*/
|
// /**
|
||||||
@GetMapping("/by-model")
|
// * 根据型号查询
|
||||||
@Operation(summary = "根据型号查询")
|
// */
|
||||||
public Result<List<GardsCorrectionFactor>> getByModel(@RequestParam String model) {
|
// @GetMapping("/by-model")
|
||||||
try {
|
// @Operation(summary = "根据型号查询")
|
||||||
List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByModel(model);
|
// public Result<List<GardsCorrectionFactor>> getByModel(@RequestParam String model) {
|
||||||
return Result.OK ("查询成功", list);
|
// try {
|
||||||
} catch (Exception e) {
|
// List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByModel(model);
|
||||||
log.error("查询失败: " + e.getMessage());
|
// return Result.OK ("查询成功", list);
|
||||||
return Result.error("查询失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
/**
|
// }
|
||||||
* 多条件组合查询
|
//
|
||||||
*/
|
// /**
|
||||||
@GetMapping("/search")
|
// * 多条件组合查询
|
||||||
@Operation(summary = "校正因子多条件组合查询")
|
// */
|
||||||
public Result<List<GardsCorrectionFactor>> search(
|
// @GetMapping("/search")
|
||||||
@RequestParam(required = false) String stationCode,
|
// @Operation(summary = "校正因子多条件组合查询")
|
||||||
@RequestParam(required = false) String detectorCode,
|
// public Result<List<GardsCorrectionFactor>> search(
|
||||||
@RequestParam(required = false) String manufacturer,
|
// @RequestParam(required = false) String stationCode,
|
||||||
@RequestParam(required = false) String model) {
|
// @RequestParam(required = false) String detectorCode,
|
||||||
try {
|
// @RequestParam(required = false) String manufacturer,
|
||||||
List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByConditions(
|
// @RequestParam(required = false) String model) {
|
||||||
stationCode, detectorCode, manufacturer, model);
|
// try {
|
||||||
return Result.OK ("查询成功", list);
|
// List<GardsCorrectionFactor> list = gardsCorrectionFactorService.getByConditions(
|
||||||
} catch (Exception e) {
|
// stationCode, detectorCode, manufacturer, model);
|
||||||
log.error("条件查询失败: " + e.getMessage());
|
// return Result.OK ("查询成功", list);
|
||||||
return Result.error("条件查询失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("条件查询失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("条件查询失败");
|
||||||
|
// }
|
||||||
/**
|
// }
|
||||||
* 批量更新校正因子
|
//
|
||||||
*/
|
// /**
|
||||||
@PutMapping("/batch")
|
// * 批量更新校正因子
|
||||||
@Operation(summary = "校正因子批量更新")
|
// */
|
||||||
public Result<?> updateBatch(@RequestBody List<GardsCorrectionFactor> factors) {
|
// @PutMapping("/batch")
|
||||||
try {
|
// @Operation(summary = "校正因子批量更新")
|
||||||
boolean success = gardsCorrectionFactorService.updateBatchCorrectionFactors(factors);
|
// public Result<?> updateBatch(@RequestBody List<GardsCorrectionFactor> factors) {
|
||||||
if (success) {
|
// try {
|
||||||
return Result.ok("批量更新成功");
|
// boolean success = gardsCorrectionFactorService.updateBatchCorrectionFactors(factors);
|
||||||
} else {
|
// if (success) {
|
||||||
return Result.error("批量更新失败");
|
// return Result.ok("批量更新成功");
|
||||||
}
|
// } else {
|
||||||
} catch (Exception e) {
|
// return Result.error("批量更新失败");
|
||||||
log.error("批量操作失败: " + e.getMessage());
|
// }
|
||||||
return Result.error("批量操作失败");
|
// } catch (Exception e) {
|
||||||
}
|
// log.error("批量操作失败: " + e.getMessage());
|
||||||
}
|
// return Result.error("批量操作失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//endregion
|
||||||
|
|
||||||
@AutoLog(value = "导出模版")
|
@AutoLog(value = "导出模版")
|
||||||
@Operation(summary = "导出模版")
|
@Operation(summary = "导出模版")
|
||||||
|
|
|
||||||
|
|
@ -41,17 +41,7 @@ public class GardsNuclearFuelFacilityController {
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "新增核燃料设施信息")
|
@Operation(summary = "新增核燃料设施信息")
|
||||||
public Result<?> create(@RequestBody GardsNuclearFuelFacilities facility) {
|
public Result<?> create(@RequestBody GardsNuclearFuelFacilities facility) {
|
||||||
try {
|
return nuclearFuelFacilitiesService.create(facility);
|
||||||
boolean success = nuclearFuelFacilitiesService.save(facility);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("核燃料设施信息添加成功", facility);
|
|
||||||
} else {
|
|
||||||
return Result.error("核燃料设施信息添加失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -60,17 +50,7 @@ public class GardsNuclearFuelFacilityController {
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "根据ID删除核燃料设施信息")
|
@Operation(summary = "根据ID删除核燃料设施信息")
|
||||||
public Result<?> delete(@RequestParam Integer id) {
|
public Result<?> delete(@RequestParam Integer id) {
|
||||||
try {
|
return nuclearFuelFacilitiesService.delete(id);
|
||||||
boolean success = nuclearFuelFacilitiesService.removeById(id);
|
|
||||||
if (success) {
|
|
||||||
return Result.ok("核燃料设施信息删除成功");
|
|
||||||
} else {
|
|
||||||
return Result.error("核燃料设施信息删除失败,可能该记录不存在");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败 ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,17 +59,7 @@ public class GardsNuclearFuelFacilityController {
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新核燃料设施信息")
|
@Operation(summary = "更新核燃料设施信息")
|
||||||
public Result<?> update(@RequestBody GardsNuclearFuelFacilities facility) {
|
public Result<?> update(@RequestBody GardsNuclearFuelFacilities facility) {
|
||||||
try {
|
return nuclearFuelFacilitiesService.update(facility);
|
||||||
boolean success = nuclearFuelFacilitiesService.updateById(facility);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("核燃料设施信息更新成功", facility);
|
|
||||||
} else {
|
|
||||||
return Result.error("核燃料设施信息更新失败,可能该记录不存在");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -98,17 +68,7 @@ public class GardsNuclearFuelFacilityController {
|
||||||
@GetMapping("/getById")
|
@GetMapping("/getById")
|
||||||
@Operation(summary = "根据ID查询核燃料设施详情")
|
@Operation(summary = "根据ID查询核燃料设施详情")
|
||||||
public Result<GardsNuclearFuelFacilities> getById(@RequestParam Integer id) {
|
public Result<GardsNuclearFuelFacilities> getById(@RequestParam Integer id) {
|
||||||
try {
|
return nuclearFuelFacilitiesService.queryById(id);
|
||||||
GardsNuclearFuelFacilities facility = nuclearFuelFacilitiesService.getById(id);
|
|
||||||
if (facility != null) {
|
|
||||||
return Result.ok(facility);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到对应的核燃料设施信息");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -123,82 +83,64 @@ public class GardsNuclearFuelFacilityController {
|
||||||
@RequestParam(required = false) String facilityStatus,
|
@RequestParam(required = false) String facilityStatus,
|
||||||
@RequestParam(required = false) String facilityName,
|
@RequestParam(required = false) String facilityName,
|
||||||
@RequestParam(required = false) String country) {
|
@RequestParam(required = false) String country) {
|
||||||
try {
|
return nuclearFuelFacilitiesService.page(pageNum, pageSize, facilityType, facilityStatus, facilityName, country);
|
||||||
Page<GardsNuclearFuelFacilities> page = new Page<>(pageNum, pageSize);
|
|
||||||
LambdaQueryWrapper<GardsNuclearFuelFacilities> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (facilityType != null && !facilityType.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getFacilityType, facilityType);
|
|
||||||
}
|
|
||||||
if (facilityStatus != null && !facilityStatus.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getFacilityStatus, facilityStatus);
|
|
||||||
}
|
|
||||||
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getFacilityName, facilityName);
|
|
||||||
}
|
|
||||||
if (country != null && !country.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getCountry, country);
|
|
||||||
}
|
|
||||||
|
|
||||||
IPage<GardsNuclearFuelFacilities> pageResult = nuclearFuelFacilitiesService.page(page, wrapper);
|
|
||||||
return Result.OK("分页查询成功", pageResult);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("分页查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//region 注释代码
|
||||||
* 查询所有核燃料设施列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
@Operation(summary = "查询所有核燃料设施列表")
|
|
||||||
public Result<List<GardsNuclearFuelFacilities>> list() {
|
|
||||||
try {
|
|
||||||
List<GardsNuclearFuelFacilities> list = nuclearFuelFacilitiesService.list();
|
|
||||||
return Result.OK("查询成功", list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 根据设施名称模糊查询
|
// * 查询所有核燃料设施列表
|
||||||
*/
|
// */
|
||||||
@GetMapping("/by-name")
|
// @GetMapping("/list")
|
||||||
@Operation(summary = "根据设施名称模糊查询")
|
// @Operation(summary = "查询所有核燃料设施列表")
|
||||||
public Result<List<GardsNuclearFuelFacilities>> getByFacilityNameLike(@RequestParam String facilityName) {
|
// public Result<List<GardsNuclearFuelFacilities>> list() {
|
||||||
try {
|
// try {
|
||||||
List<GardsNuclearFuelFacilities> list = nuclearFuelFacilitiesService.getByFacilityNameLike(facilityName);
|
// List<GardsNuclearFuelFacilities> list = nuclearFuelFacilitiesService.list();
|
||||||
return Result.OK("查询成功", list);
|
// return Result.OK("查询成功", list);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
log.error("操作失败: " + e.getMessage());
|
// log.error("操作失败: " + e.getMessage());
|
||||||
return Result.error("查询失败");
|
// return Result.error("查询失败");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 根据设施名称模糊查询
|
||||||
|
// */
|
||||||
|
// @GetMapping("/by-name")
|
||||||
|
// @Operation(summary = "根据设施名称模糊查询")
|
||||||
|
// public Result<List<GardsNuclearFuelFacilities>> getByFacilityNameLike(@RequestParam String facilityName) {
|
||||||
|
// try {
|
||||||
|
// List<GardsNuclearFuelFacilities> list = nuclearFuelFacilitiesService.getByFacilityNameLike(facilityName);
|
||||||
|
// return Result.OK("查询成功", list);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("操作失败: " + e.getMessage());
|
||||||
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 多条件组合查询
|
||||||
|
// */
|
||||||
|
// @GetMapping("/search")
|
||||||
|
// @Operation(summary = "多条件组合查询")
|
||||||
|
// public Result<List<GardsNuclearFuelFacilities>> search(
|
||||||
|
// @RequestParam(required = false) String facilityType,
|
||||||
|
// @RequestParam(required = false) String facilityStatus,
|
||||||
|
// @RequestParam(required = false) String country,
|
||||||
|
// @RequestParam(required = false) String facilityName,
|
||||||
|
// @RequestParam(required = false) String fuelType) {
|
||||||
|
// try {
|
||||||
|
// List<GardsNuclearFuelFacilities> list = nuclearFuelFacilitiesService.getByConditions(
|
||||||
|
// facilityType, facilityStatus, country, facilityName, fuelType);
|
||||||
|
// return Result.OK("查询成功", list);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("操作失败: " + e.getMessage());
|
||||||
|
// return Result.error("条件查询失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//endregion
|
||||||
/**
|
|
||||||
* 多条件组合查询
|
|
||||||
*/
|
|
||||||
@GetMapping("/search")
|
|
||||||
@Operation(summary = "多条件组合查询")
|
|
||||||
public Result<List<GardsNuclearFuelFacilities>> search(
|
|
||||||
@RequestParam(required = false) String facilityType,
|
|
||||||
@RequestParam(required = false) String facilityStatus,
|
|
||||||
@RequestParam(required = false) String country,
|
|
||||||
@RequestParam(required = false) String facilityName,
|
|
||||||
@RequestParam(required = false) String fuelType) {
|
|
||||||
try {
|
|
||||||
List<GardsNuclearFuelFacilities> list = nuclearFuelFacilitiesService.getByConditions(
|
|
||||||
facilityType, facilityStatus, country, facilityName, fuelType);
|
|
||||||
return Result.OK("查询成功", list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("条件查询失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "导出模版")
|
@AutoLog(value = "导出模版")
|
||||||
@Operation(summary = "导出模版")
|
@Operation(summary = "导出模版")
|
||||||
|
|
|
||||||
|
|
@ -49,17 +49,7 @@ public class GardsNuclearReactorsController {
|
||||||
@Operation(summary = "新增核设施信息")
|
@Operation(summary = "新增核设施信息")
|
||||||
public Result<?> create(@RequestBody GardsNuclearReactors gardsNuclearReactors) {
|
public Result<?> create(@RequestBody GardsNuclearReactors gardsNuclearReactors) {
|
||||||
|
|
||||||
try {
|
return gardsNuclearReactorsService.create(gardsNuclearReactors);
|
||||||
boolean success = gardsNuclearReactorsService.save(gardsNuclearReactors);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("添加核设施信息成功", gardsNuclearReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("添加核设施信息失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("新增操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -71,17 +61,7 @@ public class GardsNuclearReactorsController {
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除核设施信息数据")
|
@Operation(summary = "删除核设施信息数据")
|
||||||
public Result<?> delete(@RequestParam Integer id) {
|
public Result<?> delete(@RequestParam Integer id) {
|
||||||
try {
|
return gardsNuclearReactorsService.delete(id);
|
||||||
boolean success = gardsNuclearReactorsService.removeById(id);
|
|
||||||
if (success) {
|
|
||||||
return Result.ok("核设施信息删除成功");
|
|
||||||
}
|
|
||||||
return Result.error("删除核设施信息失败,可能该记录不存在");
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -93,18 +73,7 @@ public class GardsNuclearReactorsController {
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新核设施数据")
|
@Operation(summary = "更新核设施数据")
|
||||||
public Result<?> update(@RequestBody GardsNuclearReactors gardsNuclearReactors) {
|
public Result<?> update(@RequestBody GardsNuclearReactors gardsNuclearReactors) {
|
||||||
try {
|
return gardsNuclearReactorsService.update(gardsNuclearReactors);
|
||||||
boolean success = gardsNuclearReactorsService.updateById(gardsNuclearReactors);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("更新成功", gardsNuclearReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("更新失败,或者记录不存在");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -115,18 +84,8 @@ public class GardsNuclearReactorsController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getById")
|
@GetMapping("/getById")
|
||||||
@Operation(summary = "根据Id查询反应堆数据")
|
@Operation(summary = "根据Id查询反应堆数据")
|
||||||
public Result<GardsNuclearReactors> getById(@RequestParam Integer id) {
|
public Result<GardsNuclearReactors> queryById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsNuclearReactorsService.queryById(id);
|
||||||
GardsNuclearReactors nuclearReactors = gardsNuclearReactorsService.getById(id);
|
|
||||||
if (nuclearReactors != null) {
|
|
||||||
return Result.OK(nuclearReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到核设施信息数据");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("操作失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,55 +106,42 @@ public class GardsNuclearReactorsController {
|
||||||
@RequestParam(required = false) String unitName,
|
@RequestParam(required = false) String unitName,
|
||||||
@RequestParam(required = false) String country) {
|
@RequestParam(required = false) String country) {
|
||||||
|
|
||||||
try {
|
return gardsNuclearReactorsService.page(pageNum, pageSize, unitName, country);
|
||||||
Page<GardsNuclearReactors> page = new Page<>(pageNum, pageSize);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<GardsNuclearReactors> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (unitName != null && !unitName.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearReactors::getUnitName, unitName);
|
|
||||||
}
|
|
||||||
if (country != null && !country.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearReactors::getCountry, country);
|
|
||||||
}
|
|
||||||
IPage<GardsNuclearReactors> pageResult = gardsNuclearReactorsService.page(page, wrapper);
|
|
||||||
|
|
||||||
return Result.OK(pageResult);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("查询失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//region 注释代码
|
||||||
* 组合条件查询
|
|
||||||
*
|
|
||||||
* @param unitName 名称
|
|
||||||
* @param country 国家
|
|
||||||
* @param reactorType reactorType
|
|
||||||
* @param reactorStatus reactorStatus
|
|
||||||
* @return list
|
|
||||||
*/
|
|
||||||
@GetMapping("/search")
|
|
||||||
@Operation(summary = "核设施信息组合条件查询")
|
|
||||||
public Result<List<GardsNuclearReactors>> search(@RequestParam(required = false) String unitName,
|
|
||||||
@RequestParam(required = false) String country,
|
|
||||||
@RequestParam(required = false) String reactorType,
|
|
||||||
@RequestParam(required = false) String reactorStatus) {
|
|
||||||
|
|
||||||
try {
|
// /**
|
||||||
List<GardsNuclearReactors> list = gardsNuclearReactorsService.getByConditions(unitName, country, reactorType, reactorStatus);
|
// * 组合条件查询
|
||||||
return Result.OK(list);
|
// *
|
||||||
} catch (Exception e) {
|
// * @param unitName 名称
|
||||||
log.error("条件查询失败: " + e.getMessage());
|
// * @param country 国家
|
||||||
return Result.error("条件查询失败");
|
// * @param reactorType reactorType
|
||||||
}
|
// * @param reactorStatus reactorStatus
|
||||||
|
// * @return list
|
||||||
|
// */
|
||||||
}
|
// @GetMapping("/search")
|
||||||
|
// @Operation(summary = "核设施信息组合条件查询")
|
||||||
|
// public Result<List<GardsNuclearReactors>> search(@RequestParam(required = false) String unitName,
|
||||||
|
// @RequestParam(required = false) String country,
|
||||||
|
// @RequestParam(required = false) String reactorType,
|
||||||
|
// @RequestParam(required = false) String reactorStatus) {
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// List<GardsNuclearReactors> list = gardsNuclearReactorsService.getByConditions(unitName, country, reactorType, reactorStatus);
|
||||||
|
// return Result.OK(list);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("条件查询失败: " + e.getMessage());
|
||||||
|
// return Result.error("条件查询失败");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
|
||||||
@AutoLog(value = "导出模版")
|
@AutoLog(value = "导出模版")
|
||||||
@Operation(summary = "核设施信息导出模版")
|
@Operation(summary = "核设施信息导出模版")
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/gardsNuclearReleaseRecords")
|
@RequestMapping("/gardsNuclearReleaseRecords")
|
||||||
|
|
@ -40,17 +41,7 @@ public class GardsNuclearReleaseController {
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "新增加核设施放射性排放记录信息")
|
@Operation(summary = "新增加核设施放射性排放记录信息")
|
||||||
public Result<?> create(@RequestBody GardsNuclearReleaseRecords gardsNuclearReleaseRecords) {
|
public Result<?> create(@RequestBody GardsNuclearReleaseRecords gardsNuclearReleaseRecords) {
|
||||||
try {
|
return gardsNuclearReleaseService.create(gardsNuclearReleaseRecords);
|
||||||
boolean success = gardsNuclearReleaseService.save(gardsNuclearReleaseRecords);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("添加成功", gardsNuclearReleaseRecords);
|
|
||||||
} else {
|
|
||||||
return Result.error("添加失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("create: " + e.getMessage());
|
|
||||||
return Result.error("添加失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -59,18 +50,7 @@ public class GardsNuclearReleaseController {
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除核设施放射性排放记录信息")
|
@Operation(summary = "删除核设施放射性排放记录信息")
|
||||||
public Result<?> deleteById(@RequestParam Integer id) {
|
public Result<?> deleteById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsNuclearReleaseService.deleteById(id);
|
||||||
boolean success = gardsNuclearReleaseService.removeById(id);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("删除成功");
|
|
||||||
} else {
|
|
||||||
return Result.error("删除失败,可能数据不存在");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("deleteById: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,18 +59,7 @@ public class GardsNuclearReleaseController {
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新核设施放射性排放记录信息")
|
@Operation(summary = "更新核设施放射性排放记录信息")
|
||||||
public Result<?> update(@RequestBody GardsNuclearReleaseRecords gardsNuclearReleaseRecords) {
|
public Result<?> update(@RequestBody GardsNuclearReleaseRecords gardsNuclearReleaseRecords) {
|
||||||
try {
|
return gardsNuclearReleaseService.update(gardsNuclearReleaseRecords);
|
||||||
boolean success = gardsNuclearReleaseService.updateById(gardsNuclearReleaseRecords);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("数据更新成功", gardsNuclearReleaseRecords);
|
|
||||||
} else {
|
|
||||||
return Result.error("数据更新失败");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("update: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -99,25 +68,15 @@ public class GardsNuclearReleaseController {
|
||||||
@GetMapping("/queryById")
|
@GetMapping("/queryById")
|
||||||
@Operation(summary = "查询核设施放射性排放记录信息")
|
@Operation(summary = "查询核设施放射性排放记录信息")
|
||||||
public Result<GardsNuclearReleaseRecords> getById(@RequestParam Integer id) {
|
public Result<GardsNuclearReleaseRecords> getById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsNuclearReleaseService.queryById(id);
|
||||||
GardsNuclearReleaseRecords nuclearReactors = gardsNuclearReleaseService.getById(id);
|
|
||||||
if (nuclearReactors != null) {
|
|
||||||
return Result.OK(nuclearReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到数据");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("getById: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
*
|
||||||
* @param pageNum
|
* @param pageNum 页数
|
||||||
* @param pageSize
|
* @param pageSize 每页大小
|
||||||
* @param siteName
|
* @param facilityName
|
||||||
* @param nuclide
|
* @param nuclide
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -126,57 +85,43 @@ public class GardsNuclearReleaseController {
|
||||||
public Result<IPage<GardsNuclearReleaseRecords>> page(
|
public Result<IPage<GardsNuclearReleaseRecords>> page(
|
||||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
@RequestParam(required = false) String siteName,
|
@RequestParam(required = false) String facilityName,
|
||||||
@RequestParam(required = false) String nuclide) {
|
@RequestParam(required = false) String nuclide) {
|
||||||
|
return gardsNuclearReleaseService.page(pageNum, pageSize, facilityName, nuclide);
|
||||||
try {
|
|
||||||
Page<GardsNuclearReleaseRecords> page = new Page<>(pageNum, pageSize);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<GardsNuclearReleaseRecords> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (siteName != null && !siteName.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearReleaseRecords::getSiteName, siteName);
|
|
||||||
}
|
|
||||||
if (nuclide != null && !nuclide.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsNuclearReleaseRecords::getNuclide, nuclide);
|
|
||||||
}
|
|
||||||
IPage<GardsNuclearReleaseRecords> pageResult = gardsNuclearReleaseService.page(page, wrapper);
|
|
||||||
|
|
||||||
return Result.OK(pageResult);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("page: " + e.getMessage());
|
|
||||||
return Result.error("查询失败:");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//region 注释代码
|
||||||
* 组合条件查询
|
//
|
||||||
*
|
// /**
|
||||||
* @param siteName 地点名称
|
// * 组合条件查询
|
||||||
* @param nuclide 具体核素
|
// *
|
||||||
* @param nuclideType 核素类型
|
// * @param siteName 地点名称
|
||||||
* @param releaseType 释放类型
|
// * @param nuclide 具体核素
|
||||||
* @return
|
// * @param nuclideType 核素类型
|
||||||
*/
|
// * @param releaseType 释放类型
|
||||||
@GetMapping("/search")
|
// * @return
|
||||||
@Operation(summary = "核设施放射性排放记录组合条件查询")
|
// */
|
||||||
public Result<List<GardsNuclearReleaseRecords>> search(
|
// @GetMapping("/search")
|
||||||
@RequestParam(required = false) String siteName,
|
// @Operation(summary = "核设施放射性排放记录组合条件查询")
|
||||||
@RequestParam(required = false) String nuclide,
|
// public Result<List<GardsNuclearReleaseRecords>> search(
|
||||||
@RequestParam(required = false) String nuclideType,
|
// @RequestParam(required = false) String siteName,
|
||||||
@RequestParam(required = false) String releaseType) {
|
// @RequestParam(required = false) String nuclide,
|
||||||
|
// @RequestParam(required = false) String nuclideType,
|
||||||
|
// @RequestParam(required = false) String releaseType) {
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// List<GardsNuclearReleaseRecords> list = gardsNuclearReleaseService.getByConditions(siteName, nuclide, nuclideType, releaseType);
|
||||||
|
// return Result.OK(list);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("条件查询失败: " + e.getMessage());
|
||||||
|
// return Result.error("查询失败");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
try {
|
//endregion
|
||||||
List<GardsNuclearReleaseRecords> list = gardsNuclearReleaseService.getByConditions(siteName, nuclide, nuclideType, releaseType);
|
|
||||||
return Result.OK(list);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("条件查询失败: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "导出模版")
|
@AutoLog(value = "导出模版")
|
||||||
@Operation(summary = "核设施放射性排放记录导出模版")
|
@Operation(summary = "核设施放射性排放记录导出模版")
|
||||||
|
|
@ -195,16 +140,15 @@ public class GardsNuclearReleaseController {
|
||||||
@Operation(summary = "核设施放射性排放记录导出Excel")
|
@Operation(summary = "核设施放射性排放记录导出Excel")
|
||||||
@GetMapping("/exportExcel")
|
@GetMapping("/exportExcel")
|
||||||
public void exportExcel(HttpServletResponse response,
|
public void exportExcel(HttpServletResponse response,
|
||||||
@RequestParam(required = false) String siteName,
|
@RequestParam(required = false) String facilityName,
|
||||||
@RequestParam(required = false) String nuclide,
|
@RequestParam(required = false) String nuclide,
|
||||||
@RequestParam(required = false) String nuclideType,
|
@RequestParam(required = false) String matterState) throws IOException {
|
||||||
@RequestParam(required = false) String releaseType) throws IOException {
|
|
||||||
ExportParams params = new ExportParams();
|
ExportParams params = new ExportParams();
|
||||||
params.setTitle("核设施放射性排放记录信息");
|
params.setTitle("核设施放射性排放记录信息");
|
||||||
params.setFixedTitle(true);
|
params.setFixedTitle(true);
|
||||||
params.setTitleHeight((short) 8);
|
params.setTitleHeight((short) 8);
|
||||||
params.setType(ExcelType.XSSF);
|
params.setType(ExcelType.XSSF);
|
||||||
List<GardsNuclearReleaseRecords> list = gardsNuclearReleaseService.getByConditions(siteName, nuclide, nuclideType, releaseType);
|
List<GardsNuclearReleaseRecords> list = gardsNuclearReleaseService.getByConditions(facilityName, nuclide, matterState);
|
||||||
ExcelExportUtil.exportExcel(params, GardsNuclearReleaseRecords.class, list).write(response.getOutputStream());
|
ExcelExportUtil.exportExcel(params, GardsNuclearReleaseRecords.class, list).write(response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,7 @@ public class GardsNuclearTestingPlantController {
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "新增核试验信息")
|
@Operation(summary = "新增核试验信息")
|
||||||
public Result<?> create(@RequestBody GardsNuclearTestingPlant gardsNuclearTestingPlant) {
|
public Result<?> create(@RequestBody GardsNuclearTestingPlant gardsNuclearTestingPlant) {
|
||||||
try {
|
return gardsNuclearTestingPlantService.create(gardsNuclearTestingPlant);
|
||||||
boolean success = gardsNuclearTestingPlantService.save(gardsNuclearTestingPlant);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("添加成功", gardsNuclearTestingPlant);
|
|
||||||
} else {
|
|
||||||
return Result.error("添加失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("create: " + e.getMessage());
|
|
||||||
return Result.error("添加失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,18 +51,7 @@ public class GardsNuclearTestingPlantController {
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除核试验信息")
|
@Operation(summary = "删除核试验信息")
|
||||||
public Result<?> deleteById(@RequestParam Integer id) {
|
public Result<?> deleteById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsNuclearTestingPlantService.deleteById(id);
|
||||||
boolean success = gardsNuclearTestingPlantService.removeById(id);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("删除成功");
|
|
||||||
} else {
|
|
||||||
return Result.error("删除失败,可能数据不存在");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("deleteById: " + e.getMessage());
|
|
||||||
return Result.error("操作失败:");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -81,18 +60,7 @@ public class GardsNuclearTestingPlantController {
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新核试验信息")
|
@Operation(summary = "更新核试验信息")
|
||||||
public Result<?> update(@RequestBody GardsNuclearTestingPlant gardsNuclearTestingPlant) {
|
public Result<?> update(@RequestBody GardsNuclearTestingPlant gardsNuclearTestingPlant) {
|
||||||
try {
|
return gardsNuclearTestingPlantService.update(gardsNuclearTestingPlant);
|
||||||
boolean success = gardsNuclearTestingPlantService.updateById(gardsNuclearTestingPlant);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("数据更新成功", gardsNuclearTestingPlant);
|
|
||||||
} else {
|
|
||||||
return Result.error("数据更新失败");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("update: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -101,17 +69,7 @@ public class GardsNuclearTestingPlantController {
|
||||||
@GetMapping("/queryById")
|
@GetMapping("/queryById")
|
||||||
@Operation(summary = "查询核试验信息")
|
@Operation(summary = "查询核试验信息")
|
||||||
public Result<GardsNuclearTestingPlant> getById(@RequestParam Integer id) {
|
public Result<GardsNuclearTestingPlant> getById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsNuclearTestingPlantService.queryById(id);
|
||||||
GardsNuclearTestingPlant nuclearReactors = gardsNuclearTestingPlantService.getById(id);
|
|
||||||
if (nuclearReactors != null) {
|
|
||||||
return Result.OK(nuclearReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到数据");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("getById: " + e.getMessage());
|
|
||||||
return Result.error("查询失败:" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -130,7 +88,6 @@ public class GardsNuclearTestingPlantController {
|
||||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
@RequestParam(required = false) String name,
|
@RequestParam(required = false) String name,
|
||||||
@RequestParam(required = false) String type) {
|
@RequestParam(required = false) String type) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Page<GardsNuclearTestingPlant> page = new Page<>(pageNum, pageSize);
|
Page<GardsNuclearTestingPlant> page = new Page<>(pageNum, pageSize);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,17 +41,7 @@ public class GardsResearchReactorsController {
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "新增反应堆信息")
|
@Operation(summary = "新增反应堆信息")
|
||||||
public Result<?> create(@RequestBody GardsResearchReactors gardsResearchReactors) {
|
public Result<?> create(@RequestBody GardsResearchReactors gardsResearchReactors) {
|
||||||
try {
|
return gardsResearchReactorsService.create(gardsResearchReactors);
|
||||||
boolean success = gardsResearchReactorsService.save(gardsResearchReactors);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("反应堆信息添加成功", gardsResearchReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("反应堆信息添加失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("create: " + e.getMessage());
|
|
||||||
return Result.error("添加失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -60,18 +50,7 @@ public class GardsResearchReactorsController {
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除反应堆信息")
|
@Operation(summary = "删除反应堆信息")
|
||||||
public Result<?> deleteById(@RequestParam Integer id) {
|
public Result<?> deleteById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsResearchReactorsService.deleteById(id);
|
||||||
boolean success = gardsResearchReactorsService.removeById(id);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("删除成功");
|
|
||||||
} else {
|
|
||||||
return Result.error("删除失败,可能数据不存在");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("deleteById: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,18 +59,7 @@ public class GardsResearchReactorsController {
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新反应堆信息")
|
@Operation(summary = "更新反应堆信息")
|
||||||
public Result<?> update(@RequestBody GardsResearchReactors gardsResearchReactors) {
|
public Result<?> update(@RequestBody GardsResearchReactors gardsResearchReactors) {
|
||||||
try {
|
return gardsResearchReactorsService.update(gardsResearchReactors);
|
||||||
boolean success = gardsResearchReactorsService.updateById(gardsResearchReactors);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("数据更新成功", gardsResearchReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("数据更新失败");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("update: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -100,17 +68,7 @@ public class GardsResearchReactorsController {
|
||||||
@GetMapping("/queryById")
|
@GetMapping("/queryById")
|
||||||
@Operation(summary = "查询反应堆信息")
|
@Operation(summary = "查询反应堆信息")
|
||||||
public Result<GardsResearchReactors> getById(@RequestParam Integer id) {
|
public Result<GardsResearchReactors> getById(@RequestParam Integer id) {
|
||||||
try {
|
return gardsResearchReactorsService.queryById(id);
|
||||||
GardsResearchReactors nuclearReactors = gardsResearchReactorsService.getById(id);
|
|
||||||
if (nuclearReactors != null) {
|
|
||||||
return Result.OK(nuclearReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到数据");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("getById: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -130,24 +88,7 @@ public class GardsResearchReactorsController {
|
||||||
@RequestParam(required = false) String facilityName,
|
@RequestParam(required = false) String facilityName,
|
||||||
@RequestParam(required = false) String country) {
|
@RequestParam(required = false) String country) {
|
||||||
|
|
||||||
try {
|
return gardsResearchReactorsService.page(pageNum, pageSize,facilityName,country);
|
||||||
Page<GardsResearchReactors> page = new Page<>(pageNum, pageSize);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<GardsResearchReactors> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsResearchReactors::getFacilityName, facilityName);
|
|
||||||
}
|
|
||||||
if (country != null && !country.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsResearchReactors::getCountry, country);
|
|
||||||
}
|
|
||||||
IPage<GardsResearchReactors> pageResult = gardsResearchReactorsService.page(page, wrapper);
|
|
||||||
|
|
||||||
return Result.OK(pageResult);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("page: " + e.getMessage());
|
|
||||||
return Result.error("查询失败" );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,17 +40,7 @@ public class GardsStationsController {
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "新增台站信息")
|
@Operation(summary = "新增台站信息")
|
||||||
public Result<?> create(@RequestBody GardsStations gardsStations) {
|
public Result<?> create(@RequestBody GardsStations gardsStations) {
|
||||||
try {
|
return gardsStationsService.create(gardsStations);
|
||||||
boolean success = gardsStationsService.save(gardsStations);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("添加成功", gardsStations);
|
|
||||||
} else {
|
|
||||||
return Result.error("添加失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("create: " + e.getMessage());
|
|
||||||
return Result.error("添加失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -59,18 +49,7 @@ public class GardsStationsController {
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除台站信息")
|
@Operation(summary = "删除台站信息")
|
||||||
public Result<?> deleteById(@RequestParam Integer stationId) {
|
public Result<?> deleteById(@RequestParam Integer stationId) {
|
||||||
try {
|
return gardsStationsService.deleteById(stationId);
|
||||||
boolean success = gardsStationsService.removeById(stationId);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("删除成功");
|
|
||||||
} else {
|
|
||||||
return Result.error("删除失败,可能数据不存在");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("deleteById: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,18 +58,7 @@ public class GardsStationsController {
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新台站信息")
|
@Operation(summary = "更新台站信息")
|
||||||
public Result<?> update(@RequestBody GardsStations gardsStations) {
|
public Result<?> update(@RequestBody GardsStations gardsStations) {
|
||||||
try {
|
return gardsStationsService.update(gardsStations);
|
||||||
boolean success = gardsStationsService.updateById(gardsStations);
|
|
||||||
if (success) {
|
|
||||||
return Result.OK("数据更新成功", gardsStations);
|
|
||||||
} else {
|
|
||||||
return Result.error("数据更新失败");
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("update: " + e.getMessage());
|
|
||||||
return Result.error("操作失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -99,17 +67,7 @@ public class GardsStationsController {
|
||||||
@GetMapping("/queryById")
|
@GetMapping("/queryById")
|
||||||
@Operation(summary = "查询台站信息")
|
@Operation(summary = "查询台站信息")
|
||||||
public Result<GardsStations> getById(@RequestParam Integer stationId) {
|
public Result<GardsStations> getById(@RequestParam Integer stationId) {
|
||||||
try {
|
return gardsStationsService.queryById(stationId);
|
||||||
GardsStations nuclearReactors = gardsStationsService.getById(stationId);
|
|
||||||
if (nuclearReactors != null) {
|
|
||||||
return Result.OK(nuclearReactors);
|
|
||||||
} else {
|
|
||||||
return Result.error("未找到数据");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("getById: " + e.getMessage());
|
|
||||||
return Result.error("查询失败" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -129,24 +87,7 @@ public class GardsStationsController {
|
||||||
@RequestParam(required = false) String stationCode,
|
@RequestParam(required = false) String stationCode,
|
||||||
@RequestParam(required = false) String countryCode) {
|
@RequestParam(required = false) String countryCode) {
|
||||||
|
|
||||||
try {
|
return gardsStationsService.page(pageNum, pageSize, stationCode, countryCode);
|
||||||
Page<GardsStations> page = new Page<>(pageNum, pageSize);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<GardsStations> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (stationCode != null && !stationCode.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsStations::getStationCode, stationCode);
|
|
||||||
}
|
|
||||||
if (countryCode != null && !countryCode.trim().isEmpty()) {
|
|
||||||
wrapper.eq(GardsStations::getCountryCode, countryCode);
|
|
||||||
}
|
|
||||||
IPage<GardsStations> pageResult = gardsStationsService.page(page, wrapper);
|
|
||||||
|
|
||||||
return Result.OK(pageResult);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("page: " + e.getMessage());
|
|
||||||
return Result.error("查询失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
package org.jeecg.controller;
|
|
||||||
|
|
||||||
public class Test {
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +1,29 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsAccelerator;
|
import org.jeecg.modules.base.entity.configuration.GardsAccelerator;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsAcceleratorService extends IService <GardsAccelerator> {
|
public interface GardsAcceleratorService extends IService<GardsAccelerator> {
|
||||||
|
|
||||||
|
|
||||||
|
Result<?> create(GardsAccelerator gardsAccelerator);
|
||||||
|
|
||||||
|
Result<?> delete(Integer id);
|
||||||
|
|
||||||
|
Result<?> update(GardsAccelerator gardsAccelerator);
|
||||||
|
|
||||||
|
Result<GardsAccelerator> queryById(Integer id);
|
||||||
|
|
||||||
|
Result<IPage<GardsAccelerator>> queryPage(Integer pageNum, Integer pageSize, String country, String facilityName);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 根据设施代码查询设施信息
|
||||||
* 根据设施代码查询设施信息
|
* 根据设施代码查询设施信息
|
||||||
*/
|
*/
|
||||||
GardsAccelerator getByFacilityCode(String facilityCode);
|
GardsAccelerator getByFacilityCode(String facilityCode);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,51 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactor;
|
import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsCorrectionFactorService extends IService<GardsCorrectionFactor> {
|
public interface GardsCorrectionFactorService extends IService<GardsCorrectionFactor> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增校正因子
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> create(GardsCorrectionFactor gardsCorrectionFactor) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID删除校正因子
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> delete( Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校正因子信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> update(GardsCorrectionFactor gardsCorrectionFactor) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询校正因子详情
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<GardsCorrectionFactor> queryById(Integer id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询校正因子列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<IPage<GardsCorrectionFactor>> page(Integer pageNum, Integer pageSize, String stationCode, String detectorCode);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据站点代码查询校正因子列表
|
* 根据站点代码查询校正因子列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearFuelFacilities;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearFuelFacilities;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -10,6 +16,42 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface GardsNuclearFuelFacilityService extends IService<GardsNuclearFuelFacilities> {
|
public interface GardsNuclearFuelFacilityService extends IService<GardsNuclearFuelFacilities> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增核燃料设施信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> create(GardsNuclearFuelFacilities facility);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID删除核燃料设施信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> delete(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新核燃料设施信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> update(GardsNuclearFuelFacilities facility);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询核燃料设施详情
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<GardsNuclearFuelFacilities> queryById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询核燃料设施列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<IPage<GardsNuclearFuelFacilities>> page(Integer pageNum, Integer pageSize,
|
||||||
|
String facilityType,
|
||||||
|
String facilityStatus,
|
||||||
|
String facilityName,
|
||||||
|
String country);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设施名称模糊查询
|
* 根据设施名称模糊查询
|
||||||
*/
|
*/
|
||||||
|
|
@ -18,7 +60,7 @@ public interface GardsNuclearFuelFacilityService extends IService<GardsNuclearFu
|
||||||
/**
|
/**
|
||||||
* 多条件组合查询
|
* 多条件组合查询
|
||||||
*/
|
*/
|
||||||
List<GardsNuclearFuelFacilities> getByConditions(String facilityType, String facilityStatus, String country,String facilityName, String fuelType);
|
List<GardsNuclearFuelFacilities> getByConditions(String facilityType, String facilityStatus, String country, String facilityName, String fuelType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量更新设施状态
|
* 批量更新设施状态
|
||||||
|
|
@ -26,5 +68,4 @@ public interface GardsNuclearFuelFacilityService extends IService<GardsNuclearFu
|
||||||
boolean updateBatchFacilityStatus(List<Long> ids, String status);
|
boolean updateBatchFacilityStatus(List<Long> ids, String status);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,70 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
||||||
import org.jeecg.modules.base.mapper.GardsNuclearReactorsMapper;
|
import org.jeecg.modules.base.mapper.GardsNuclearReactorsMapper;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsNuclearReactorsService extends IService<GardsNuclearReactors> {
|
public interface GardsNuclearReactorsService extends IService<GardsNuclearReactors> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增 核设施信息
|
||||||
|
*
|
||||||
|
* @param gardsNuclearReactors
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> create(@RequestBody GardsNuclearReactors gardsNuclearReactors);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除反应堆数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> delete(@RequestParam Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新反应堆数据
|
||||||
|
*
|
||||||
|
* @param gardsNuclearReactors
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> update(@RequestBody GardsNuclearReactors gardsNuclearReactors);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Id查询反应堆数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<GardsNuclearReactors> queryById(@RequestParam Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询反应堆数据
|
||||||
|
*
|
||||||
|
* @param pageNum 页码
|
||||||
|
* @param pageSize 分页大小
|
||||||
|
* @param unitName 单位名称
|
||||||
|
* @param country 国家
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<IPage<GardsNuclearReactors>> page( Integer pageNum,
|
||||||
|
Integer pageSize,
|
||||||
|
String unitName,
|
||||||
|
String country);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多条件组合查询
|
* 多条件组合查询
|
||||||
* @return List
|
* @return List
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,65 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearReleaseRecords;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearReleaseRecords;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsNuclearReleaseService extends IService<GardsNuclearReleaseRecords> {
|
public interface GardsNuclearReleaseService extends IService<GardsNuclearReleaseRecords> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增加核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> create(GardsNuclearReleaseRecords gardsNuclearReleaseRecords);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> deleteById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> update(GardsNuclearReleaseRecords gardsNuclearReleaseRecords);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<GardsNuclearReleaseRecords> queryById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageNum 页数
|
||||||
|
* @param pageSize 每页大小
|
||||||
|
* @param facilityName 设施名称
|
||||||
|
* @param nuclide 核素
|
||||||
|
* @return 分页结果
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<IPage<GardsNuclearReleaseRecords>> page(Integer pageNum, Integer pageSize, String facilityName, String nuclide);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多条件组合查询
|
* 多条件组合查询
|
||||||
* @param siteName 站点/电厂名称
|
*
|
||||||
* @param nuclide 具体核素
|
* @param facilityName 站点/电厂名称
|
||||||
* @param nuclideType 核素类别
|
* @param nuclide 具体核素
|
||||||
* @param releaseType 排放类型
|
* @param matterState 物质状态 1-气体,2-气溶胶
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<GardsNuclearReleaseRecords> getByConditions(String siteName, String nuclide, String nuclideType, String releaseType);
|
List<GardsNuclearReleaseRecords> getByConditions(String facilityName, String nuclide, String matterState);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,55 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearReleaseRecords;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearReleaseRecords;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsNuclearTestingPlantService extends IService<GardsNuclearTestingPlant> {
|
public interface GardsNuclearTestingPlantService extends IService<GardsNuclearTestingPlant> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增 核试验信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> create(GardsNuclearTestingPlant gardsNuclearTestingPlant);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> deleteById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> update(GardsNuclearTestingPlant gardsNuclearTestingPlant);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<GardsNuclearTestingPlant> queryById(Integer id);
|
||||||
|
|
||||||
|
Result<IPage<GardsNuclearTestingPlant>> page(
|
||||||
|
Integer pageNum,
|
||||||
|
Integer pageSize,
|
||||||
|
String name,
|
||||||
|
String type);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多条件组合查询
|
* 多条件组合查询
|
||||||
* @param name 名称
|
*
|
||||||
|
* @param name 名称
|
||||||
* @param type 类型
|
* @param type 类型
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,58 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsResearchReactorsService extends IService<GardsResearchReactors> {
|
public interface GardsResearchReactorsService extends IService<GardsResearchReactors> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> create(@RequestBody GardsResearchReactors gardsResearchReactors);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> deleteById(@RequestParam Integer id) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新反应堆信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> update(@RequestBody GardsResearchReactors gardsResearchReactors) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<GardsResearchReactors> queryById(@RequestParam Integer id) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageNum
|
||||||
|
* @param pageSize
|
||||||
|
* @param facilityName
|
||||||
|
* @param country
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<IPage<GardsResearchReactors>> page(
|
||||||
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
|
@RequestParam(required = false) String facilityName,
|
||||||
|
@RequestParam(required = false) String country) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多条件组合查询
|
* 多条件组合查询
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,63 @@
|
||||||
package org.jeecg.service;
|
package org.jeecg.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsStations;
|
import org.jeecg.modules.base.entity.configuration.GardsStations;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GardsStationsService extends IService<GardsStations> {
|
public interface GardsStationsService extends IService<GardsStations> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
Result<?> create( GardsStations gardsStations) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除信息
|
||||||
|
*/
|
||||||
|
Result<?> deleteById( Integer stationId) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新信息
|
||||||
|
*/
|
||||||
|
Result<?> update( GardsStations gardsStations);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询信息
|
||||||
|
*/
|
||||||
|
Result<GardsStations> queryById( Integer stationId) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageNum
|
||||||
|
* @param pageSize
|
||||||
|
* @param stationCode
|
||||||
|
* @param countryCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result<IPage<GardsStations>> page(
|
||||||
|
Integer pageNum,
|
||||||
|
Integer pageSize,
|
||||||
|
String stationCode,
|
||||||
|
String countryCode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多条件组合查询
|
* 多条件组合查询
|
||||||
* @param stationCode 名称
|
* @param stationCode 名称
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,15 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsAccelerator;
|
import org.jeecg.modules.base.entity.configuration.GardsAccelerator;
|
||||||
import org.jeecg.modules.base.mapper.GardsAcceleratorMapper;
|
import org.jeecg.modules.base.mapper.GardsAcceleratorMapper;
|
||||||
import org.jeecg.service.GardsAcceleratorService;
|
import org.jeecg.service.GardsAcceleratorService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -14,6 +18,95 @@ import java.util.List;
|
||||||
public class GardsAcceleratorServiceImpl extends ServiceImpl<GardsAcceleratorMapper,GardsAccelerator> implements GardsAcceleratorService {
|
public class GardsAcceleratorServiceImpl extends ServiceImpl<GardsAcceleratorMapper,GardsAccelerator> implements GardsAcceleratorService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create(GardsAccelerator gardsAccelerator) {
|
||||||
|
try {
|
||||||
|
boolean success = this.save(gardsAccelerator);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("添加成功",gardsAccelerator);
|
||||||
|
} else {
|
||||||
|
return Result.error("设施信息添加失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> delete(Integer id) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(id);
|
||||||
|
if (success) {
|
||||||
|
return Result.ok("删除成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("设施信息删除失败,可能该记录不存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update(GardsAccelerator gardsAccelerator) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(gardsAccelerator);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("设施信息更新成功",gardsAccelerator);
|
||||||
|
} else {
|
||||||
|
return Result.error("设施信息更新失败,可能该记录不存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<IPage<GardsAccelerator>> queryPage(Integer pageNum, Integer pageSize, String country, String facilityName)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
Page<GardsAccelerator> page = new Page<>(pageNum, pageSize);
|
||||||
|
LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsAccelerator::getFacilityName, facilityName);
|
||||||
|
}
|
||||||
|
if (country != null && !country.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsAccelerator::getCountry, country);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsAccelerator::getId);
|
||||||
|
|
||||||
|
IPage<GardsAccelerator> pageResult = this.page(page, wrapper);
|
||||||
|
return Result.ok(pageResult);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("分页查询失败: " + e.getMessage());
|
||||||
|
return Result.error("分页查询失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<GardsAccelerator> queryById(Integer id) {
|
||||||
|
try {
|
||||||
|
GardsAccelerator facility = this.getById(id);
|
||||||
|
if (facility != null) {
|
||||||
|
return Result.ok(facility);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到对应的设施信息");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GardsAccelerator getByFacilityCode(String facilityCode) {
|
public GardsAccelerator getByFacilityCode(String facilityCode) {
|
||||||
LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsAccelerator> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,132 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.modules.base.entity.configuration.GardsAccelerator;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactor;
|
import org.jeecg.modules.base.entity.configuration.GardsCorrectionFactor;
|
||||||
import org.jeecg.modules.base.mapper.GardsCorrectionFactorMapper;
|
import org.jeecg.modules.base.mapper.GardsCorrectionFactorMapper;
|
||||||
import org.jeecg.service.GardsCorrectionFactorService;
|
import org.jeecg.service.GardsCorrectionFactorService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsCorrectionFactorServiceImpl extends ServiceImpl<GardsCorrectionFactorMapper,GardsCorrectionFactor> implements GardsCorrectionFactorService {
|
public class GardsCorrectionFactorServiceImpl extends ServiceImpl<GardsCorrectionFactorMapper, GardsCorrectionFactor> implements GardsCorrectionFactorService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增校正因子
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create(@RequestBody GardsCorrectionFactor gardsCorrectionFactor) {
|
||||||
|
try {
|
||||||
|
boolean success = this.save(gardsCorrectionFactor);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("校正因子添加成功", gardsCorrectionFactor);
|
||||||
|
} else {
|
||||||
|
return Result.error("校正因子添加失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID删除校正因子
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> delete(Integer id) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(id);
|
||||||
|
if (success) {
|
||||||
|
return Result.ok("校正因子删除成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("校正因子删除失败,可能该记录不存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校正因子信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update(GardsCorrectionFactor gardsCorrectionFactor) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(gardsCorrectionFactor);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("校正因子更新成功", gardsCorrectionFactor);
|
||||||
|
} else {
|
||||||
|
return Result.error("校正因子更新失败,可能该记录不存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询校正因子详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<GardsCorrectionFactor> queryById(Integer id) {
|
||||||
|
try {
|
||||||
|
GardsCorrectionFactor factor = this.getById(id);
|
||||||
|
if (factor != null) {
|
||||||
|
return Result.OK("查询成功", factor);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到对应的校正因子信息");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询校正因子列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<IPage<GardsCorrectionFactor>> page(
|
||||||
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
|
@RequestParam(required = false) String stationCode,
|
||||||
|
@RequestParam(required = false) String detectorCode) {
|
||||||
|
try {
|
||||||
|
Page<GardsCorrectionFactor> page = new Page<>(pageNum, pageSize);
|
||||||
|
LambdaQueryWrapper<GardsCorrectionFactor> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (stationCode != null && !stationCode.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsCorrectionFactor::getStationCode, stationCode);
|
||||||
|
}
|
||||||
|
if (detectorCode != null && !detectorCode.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsCorrectionFactor::getDetectorCode, detectorCode);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsCorrectionFactor::getId);
|
||||||
|
IPage<GardsCorrectionFactor> pageResult = this.page(page, wrapper);
|
||||||
|
return Result.OK("分页查询成功", pageResult);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("分页查询失败: " + e.getMessage());
|
||||||
|
return Result.error("分页查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GardsCorrectionFactor> getByStationCode(String stationCode) {
|
public List<GardsCorrectionFactor> getByStationCode(String stationCode) {
|
||||||
|
|
@ -57,18 +171,18 @@ public class GardsCorrectionFactorServiceImpl extends ServiceImpl<GardsCorrectio
|
||||||
LambdaQueryWrapper<GardsCorrectionFactor> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsCorrectionFactor> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (stationCode != null && !stationCode.trim().isEmpty()) {
|
if (stationCode != null && !stationCode.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsCorrectionFactor::getStationCode, stationCode);
|
wrapper.like(GardsCorrectionFactor::getStationCode, stationCode);
|
||||||
}
|
}
|
||||||
if (detectorCode != null && !detectorCode.trim().isEmpty()) {
|
if (detectorCode != null && !detectorCode.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsCorrectionFactor::getDetectorCode, detectorCode);
|
wrapper.like(GardsCorrectionFactor::getDetectorCode, detectorCode);
|
||||||
}
|
}
|
||||||
if (manufacturer != null && !manufacturer.trim().isEmpty()) {
|
if (manufacturer != null && !manufacturer.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsCorrectionFactor::getManufacturer, manufacturer);
|
wrapper.like(GardsCorrectionFactor::getManufacturer, manufacturer);
|
||||||
}
|
}
|
||||||
if (model != null && !model.trim().isEmpty()) {
|
if (model != null && !model.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsCorrectionFactor::getModel, model);
|
wrapper.like(GardsCorrectionFactor::getModel, model);
|
||||||
}
|
}
|
||||||
|
wrapper.orderByDesc(GardsCorrectionFactor::getId);
|
||||||
return this.list(wrapper);
|
return this.list(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,133 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearFuelFacilities;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearFuelFacilities;
|
||||||
import org.jeecg.modules.base.mapper.GardsNuclearFuelFacilitiesMapper;
|
import org.jeecg.modules.base.mapper.GardsNuclearFuelFacilitiesMapper;
|
||||||
import org.jeecg.service.GardsNuclearFuelFacilityService;
|
import org.jeecg.service.GardsNuclearFuelFacilityService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsNuclearFuelFacilityServiceImpl extends ServiceImpl<GardsNuclearFuelFacilitiesMapper,GardsNuclearFuelFacilities> implements GardsNuclearFuelFacilityService {
|
public class GardsNuclearFuelFacilityServiceImpl extends ServiceImpl<GardsNuclearFuelFacilitiesMapper, GardsNuclearFuelFacilities> implements GardsNuclearFuelFacilityService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增核燃料设施信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create(GardsNuclearFuelFacilities facility) {
|
||||||
|
try {
|
||||||
|
boolean success = this.save(facility);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("核燃料设施信息添加成功", facility);
|
||||||
|
} else {
|
||||||
|
return Result.error("核燃料设施信息添加失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID删除核燃料设施信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> delete(Integer id) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(id);
|
||||||
|
if (success) {
|
||||||
|
return Result.ok("核燃料设施信息删除成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("核燃料设施信息删除失败,可能该记录不存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败 ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新核燃料设施信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update(GardsNuclearFuelFacilities facility) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(facility);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("核燃料设施信息更新成功", facility);
|
||||||
|
} else {
|
||||||
|
return Result.error("核燃料设施信息更新失败,可能该记录不存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询核燃料设施详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<GardsNuclearFuelFacilities> queryById(Integer id) {
|
||||||
|
try {
|
||||||
|
GardsNuclearFuelFacilities facility = this.getById(id);
|
||||||
|
if (facility != null) {
|
||||||
|
return Result.ok(facility);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到对应的核燃料设施信息");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询核燃料设施列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<IPage<GardsNuclearFuelFacilities>> page(
|
||||||
|
Integer pageNum, Integer pageSize,
|
||||||
|
String facilityType, String facilityStatus, String facilityName,
|
||||||
|
String country) {
|
||||||
|
try {
|
||||||
|
Page<GardsNuclearFuelFacilities> page = new Page<>(pageNum, pageSize);
|
||||||
|
LambdaQueryWrapper<GardsNuclearFuelFacilities> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (facilityType != null && !facilityType.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearFuelFacilities::getFacilityType, facilityType);
|
||||||
|
}
|
||||||
|
if (facilityStatus != null && !facilityStatus.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearFuelFacilities::getFacilityStatus, facilityStatus);
|
||||||
|
}
|
||||||
|
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearFuelFacilities::getFacilityName, facilityName);
|
||||||
|
}
|
||||||
|
if (country != null && !country.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearFuelFacilities::getCountry, country);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsNuclearFuelFacilities::getId);
|
||||||
|
IPage<GardsNuclearFuelFacilities> pageResult = this.page(page, wrapper);
|
||||||
|
return Result.OK("分页查询成功", pageResult);
|
||||||
|
} catch (
|
||||||
|
Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("分页查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -22,25 +139,25 @@ public class GardsNuclearFuelFacilityServiceImpl extends ServiceImpl<GardsNuclea
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GardsNuclearFuelFacilities> getByConditions(String facilityType, String facilityStatus, String country,String facilityName, String fuelType) {
|
public List<GardsNuclearFuelFacilities> getByConditions(String facilityType, String facilityStatus, String country, String facilityName, String fuelType) {
|
||||||
LambdaQueryWrapper<GardsNuclearFuelFacilities> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsNuclearFuelFacilities> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (facilityType != null && !facilityType.trim().isEmpty()) {
|
if (facilityType != null && !facilityType.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getFacilityType, facilityType);
|
wrapper.like(GardsNuclearFuelFacilities::getFacilityType, facilityType);
|
||||||
}
|
}
|
||||||
if (facilityStatus != null && !facilityStatus.trim().isEmpty()) {
|
if (facilityStatus != null && !facilityStatus.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getFacilityStatus, facilityStatus);
|
wrapper.like(GardsNuclearFuelFacilities::getFacilityStatus, facilityStatus);
|
||||||
}
|
}
|
||||||
if (country != null && !country.trim().isEmpty()) {
|
if (country != null && !country.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getCountry, country);
|
wrapper.like(GardsNuclearFuelFacilities::getCountry, country);
|
||||||
}
|
}
|
||||||
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getFacilityName, facilityName);
|
wrapper.like(GardsNuclearFuelFacilities::getFacilityName, facilityName);
|
||||||
}
|
}
|
||||||
if (fuelType != null && !fuelType.trim().isEmpty()) {
|
if (fuelType != null && !fuelType.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearFuelFacilities::getFuelType, fuelType);
|
wrapper.like(GardsNuclearFuelFacilities::getFuelType, fuelType);
|
||||||
}
|
}
|
||||||
|
wrapper.orderByDesc(GardsNuclearFuelFacilities::getId);
|
||||||
return this.list(wrapper);
|
return this.list(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,38 +2,178 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearFuelFacilities;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
||||||
import org.jeecg.modules.base.mapper.GardsNuclearReactorsMapper;
|
import org.jeecg.modules.base.mapper.GardsNuclearReactorsMapper;
|
||||||
import org.jeecg.service.GardsNuclearReactorsService;
|
import org.jeecg.service.GardsNuclearReactorsService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsNuclearReactorsServiceImpl extends ServiceImpl<GardsNuclearReactorsMapper, GardsNuclearReactors> implements GardsNuclearReactorsService {
|
public class GardsNuclearReactorsServiceImpl extends ServiceImpl<GardsNuclearReactorsMapper, GardsNuclearReactors> implements GardsNuclearReactorsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增 核设施信息
|
||||||
|
*
|
||||||
|
* @param gardsNuclearReactors
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create(GardsNuclearReactors gardsNuclearReactors) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
boolean success = this.save(gardsNuclearReactors);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("添加核设施信息成功", gardsNuclearReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("添加核设施信息失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("新增操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除反应堆数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> delete(Integer id) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(id);
|
||||||
|
if (success) {
|
||||||
|
return Result.ok("核设施信息删除成功");
|
||||||
|
}
|
||||||
|
return Result.error("删除核设施信息失败,可能该记录不存在");
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新反应堆数据
|
||||||
|
*
|
||||||
|
* @param gardsNuclearReactors
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update(GardsNuclearReactors gardsNuclearReactors) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(gardsNuclearReactors);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("更新成功", gardsNuclearReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("更新失败,或者记录不存在");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Id查询反应堆数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<GardsNuclearReactors> queryById(Integer id) {
|
||||||
|
try {
|
||||||
|
GardsNuclearReactors nuclearReactors = this.getById(id);
|
||||||
|
if (nuclearReactors != null) {
|
||||||
|
return Result.OK(nuclearReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到核设施信息数据");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("操作失败: " + e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询反应堆数据
|
||||||
|
*
|
||||||
|
* @param pageNum 页码
|
||||||
|
* @param pageSize 分页大小
|
||||||
|
* @param unitName 单位名称
|
||||||
|
* @param country 国家
|
||||||
|
* @return IPage
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<IPage<GardsNuclearReactors>> page(
|
||||||
|
Integer pageNum,
|
||||||
|
Integer pageSize,
|
||||||
|
String unitName,
|
||||||
|
String country) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Page<GardsNuclearReactors> page = new Page<>(pageNum, pageSize);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<GardsNuclearReactors> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (unitName != null && !unitName.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearReactors::getUnitName, unitName);
|
||||||
|
}
|
||||||
|
if (country != null && !country.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearReactors::getCountry, country);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsNuclearReactors::getId);
|
||||||
|
IPage<GardsNuclearReactors> pageResult = this.page(page, wrapper);
|
||||||
|
|
||||||
|
return Result.OK(pageResult);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询失败: " + e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GardsNuclearReactors> getByConditions(String unitName, String country, String reactorType, String reactorStatus) {
|
public List<GardsNuclearReactors> getByConditions(String unitName, String country, String reactorType, String reactorStatus) {
|
||||||
|
|
||||||
LambdaQueryWrapper<GardsNuclearReactors> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsNuclearReactors> wrapper = new LambdaQueryWrapper<>();
|
||||||
if (unitName != null && !unitName.trim().isEmpty()) {
|
if (unitName != null && !unitName.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearReactors::getUnitName, unitName);
|
wrapper.like(GardsNuclearReactors::getUnitName, unitName);
|
||||||
}
|
}
|
||||||
if (country != null && !country.trim().isEmpty()) {
|
if (country != null && !country.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearReactors::getCountry, country);
|
wrapper.like(GardsNuclearReactors::getCountry, country);
|
||||||
}
|
}
|
||||||
if (reactorType != null && !reactorType.trim().isEmpty()) {
|
if (reactorType != null && !reactorType.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearReactors::getReactorType, reactorType);
|
wrapper.like(GardsNuclearReactors::getReactorType, reactorType);
|
||||||
}
|
}
|
||||||
if (reactorStatus != null && !reactorStatus.trim().isEmpty()) {
|
if (reactorStatus != null && !reactorStatus.trim().isEmpty()) {
|
||||||
wrapper.eq(GardsNuclearReactors::getReactorStatus, reactorStatus);
|
wrapper.like(GardsNuclearReactors::getReactorStatus, reactorStatus);
|
||||||
}
|
}
|
||||||
|
wrapper.orderByDesc(GardsNuclearReactors::getId);
|
||||||
return this.list(wrapper);
|
return this.list(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void saveOrUpdateBatchByUniqueFields(List<GardsNuclearReactors> list) {
|
public void saveOrUpdateBatchByUniqueFields(List<GardsNuclearReactors> list) {
|
||||||
this.saveOrUpdateBatch(list);
|
this.saveOrUpdateBatch(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,33 +2,156 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearReactors;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearReleaseRecords;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearReleaseRecords;
|
||||||
import org.jeecg.modules.base.mapper.GardsNuclearReleaseRecordsMapper;
|
import org.jeecg.modules.base.mapper.GardsNuclearReleaseRecordsMapper;
|
||||||
import org.jeecg.service.GardsNuclearReleaseService;
|
import org.jeecg.service.GardsNuclearReleaseService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsNuclearReleaseServiceImpl extends ServiceImpl<GardsNuclearReleaseRecordsMapper, GardsNuclearReleaseRecords> implements GardsNuclearReleaseService {
|
public class GardsNuclearReleaseServiceImpl extends ServiceImpl<GardsNuclearReleaseRecordsMapper, GardsNuclearReleaseRecords> implements GardsNuclearReleaseService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增加核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<GardsNuclearReleaseRecords> getByConditions(String siteName, String nuclide, String nuclideType, String releaseType) {
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create(@RequestBody GardsNuclearReleaseRecords gardsNuclearReleaseRecords) {
|
||||||
|
try {
|
||||||
|
boolean success = this.save(gardsNuclearReleaseRecords);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("添加成功", gardsNuclearReleaseRecords);
|
||||||
|
} else {
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("create: " + e.getMessage());
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> deleteById(@RequestParam Integer id) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(id);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("删除成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("删除失败,可能数据不存在");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("deleteById: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update(@RequestBody GardsNuclearReleaseRecords gardsNuclearReleaseRecords) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(gardsNuclearReleaseRecords);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("数据更新成功", gardsNuclearReleaseRecords);
|
||||||
|
} else {
|
||||||
|
return Result.error("数据更新失败");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("update: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<GardsNuclearReleaseRecords> queryById(@RequestParam Integer id) {
|
||||||
|
try {
|
||||||
|
GardsNuclearReleaseRecords nuclearReactors = this.getById(id);
|
||||||
|
if (nuclearReactors != null) {
|
||||||
|
return Result.OK(nuclearReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到数据");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("getById: " + e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageNum 页数
|
||||||
|
* @param pageSize 每页大小
|
||||||
|
* @param facilityName 设施名称
|
||||||
|
* @param nuclide 核素
|
||||||
|
* @return 分页结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<IPage<GardsNuclearReleaseRecords>> page(
|
||||||
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
|
@RequestParam(required = false) String facilityName,
|
||||||
|
@RequestParam(required = false) String nuclide) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Page<GardsNuclearReleaseRecords> page = new Page<>(pageNum, pageSize);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<GardsNuclearReleaseRecords> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearReleaseRecords::getFacilityName, facilityName);
|
||||||
|
}
|
||||||
|
if (nuclide != null && !nuclide.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearReleaseRecords::getNuclide, nuclide);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsNuclearReleaseRecords::getId);
|
||||||
|
IPage<GardsNuclearReleaseRecords> pageResult = this.page(page, wrapper);
|
||||||
|
|
||||||
|
return Result.OK(pageResult);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("page: " + e.getMessage());
|
||||||
|
return Result.error("查询失败:");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GardsNuclearReleaseRecords> getByConditions(String facilityName, String nuclide, String matterState) {
|
||||||
LambdaQueryWrapper<GardsNuclearReleaseRecords> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsNuclearReleaseRecords> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (siteName != null && !siteName.trim().isEmpty()) {
|
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
||||||
queryWrapper.eq(GardsNuclearReleaseRecords::getSiteName, siteName);
|
queryWrapper.like(GardsNuclearReleaseRecords::getFacilityName, facilityName);
|
||||||
}
|
}
|
||||||
if (nuclide != null && !nuclide.trim().isEmpty()) {
|
if (nuclide != null && !nuclide.trim().isEmpty()) {
|
||||||
queryWrapper.eq(GardsNuclearReleaseRecords::getNuclide, nuclide);
|
queryWrapper.like(GardsNuclearReleaseRecords::getNuclide, nuclide);
|
||||||
}
|
}
|
||||||
if (nuclideType != null && !nuclideType.trim().isEmpty()) {
|
|
||||||
queryWrapper.eq(GardsNuclearReleaseRecords::getNuclideType, nuclideType);
|
if (matterState != null && !matterState.trim().isEmpty()) {
|
||||||
}
|
queryWrapper.like(GardsNuclearReleaseRecords::getMatterState, matterState);
|
||||||
if (releaseType != null && !releaseType.trim().isEmpty()) {
|
|
||||||
queryWrapper.eq(GardsNuclearReleaseRecords::getReleaseType, releaseType);
|
|
||||||
}
|
}
|
||||||
|
queryWrapper.orderByDesc(GardsNuclearReleaseRecords::getId);
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,145 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
||||||
import org.jeecg.modules.base.mapper.GardsNuclearTestingPlantMapper;
|
import org.jeecg.modules.base.mapper.GardsNuclearTestingPlantMapper;
|
||||||
import org.jeecg.service.GardsNuclearTestingPlantService;
|
import org.jeecg.service.GardsNuclearTestingPlantService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsNuclearTestingPlantServiceImpl extends ServiceImpl<GardsNuclearTestingPlantMapper, GardsNuclearTestingPlant> implements GardsNuclearTestingPlantService {
|
public class GardsNuclearTestingPlantServiceImpl extends ServiceImpl<GardsNuclearTestingPlantMapper, GardsNuclearTestingPlant> implements GardsNuclearTestingPlantService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增 核试验信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create(@RequestBody GardsNuclearTestingPlant gardsNuclearTestingPlant) {
|
||||||
|
try {
|
||||||
|
boolean success = this.save(gardsNuclearTestingPlant);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("添加成功", gardsNuclearTestingPlant);
|
||||||
|
} else {
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("create: " + e.getMessage());
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> deleteById(@RequestParam Integer id) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(id);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("删除成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("删除失败,可能数据不存在");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("deleteById: " + e.getMessage());
|
||||||
|
return Result.error("操作失败:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update(@RequestBody GardsNuclearTestingPlant gardsNuclearTestingPlant) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(gardsNuclearTestingPlant);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("数据更新成功", gardsNuclearTestingPlant);
|
||||||
|
} else {
|
||||||
|
return Result.error("数据更新失败");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("update: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询核设施放射性排放记录信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<GardsNuclearTestingPlant> queryById(@RequestParam Integer id) {
|
||||||
|
try {
|
||||||
|
GardsNuclearTestingPlant nuclearReactors = this.getById(id);
|
||||||
|
if (nuclearReactors != null) {
|
||||||
|
return Result.OK(nuclearReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到数据");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("getById: " + e.getMessage());
|
||||||
|
return Result.error("查询失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<IPage<GardsNuclearTestingPlant>> page(
|
||||||
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||||
|
@RequestParam(required = false) String name,
|
||||||
|
@RequestParam(required = false) String type) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Page<GardsNuclearTestingPlant> page = new Page<>(pageNum, pageSize);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<GardsNuclearTestingPlant> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (name != null && !name.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearTestingPlant::getName, name);
|
||||||
|
}
|
||||||
|
if (type != null && !type.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsNuclearTestingPlant::getCountry, type);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsNuclearTestingPlant::getId);
|
||||||
|
IPage<GardsNuclearTestingPlant> pageResult = this.page(page, wrapper);
|
||||||
|
|
||||||
|
return Result.OK(pageResult);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("page: " + e.getMessage());
|
||||||
|
return Result.error("查询失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GardsNuclearTestingPlant> getByConditions(String name, String type) {
|
public List<GardsNuclearTestingPlant> getByConditions(String name, String type) {
|
||||||
|
|
||||||
LambdaQueryWrapper<GardsNuclearTestingPlant> query = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsNuclearTestingPlant> query = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (name != null&&!name.trim().isEmpty()) {
|
if (name != null&&!name.trim().isEmpty()) {
|
||||||
query.eq(GardsNuclearTestingPlant::getName, name);
|
query.like(GardsNuclearTestingPlant::getName, name);
|
||||||
}
|
}
|
||||||
if (type != null&&!type.trim().isEmpty()) {
|
if (type != null&&!type.trim().isEmpty()) {
|
||||||
query.eq(GardsNuclearTestingPlant::getCountry, type);
|
query.like(GardsNuclearTestingPlant::getCountry, type);
|
||||||
}
|
}
|
||||||
|
query.orderByDesc(GardsNuclearTestingPlant::getId);
|
||||||
return this.list(query);
|
return this.list(query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,33 +2,158 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
import org.jeecg.modules.base.entity.configuration.GardsNuclearTestingPlant;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
||||||
import org.jeecg.modules.base.mapper.GardsResearchReactorsMapper;
|
import org.jeecg.modules.base.mapper.GardsResearchReactorsMapper;
|
||||||
import org.jeecg.service.GardsResearchReactorsService;
|
import org.jeecg.service.GardsResearchReactorsService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
@DS("ora")
|
@DS("ora")
|
||||||
public class GardsResearchReactorsServiceImpl extends ServiceImpl<GardsResearchReactorsMapper, GardsResearchReactors> implements GardsResearchReactorsService {
|
public class GardsResearchReactorsServiceImpl extends ServiceImpl<GardsResearchReactorsMapper, GardsResearchReactors> implements GardsResearchReactorsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create( GardsResearchReactors gardsResearchReactors) {
|
||||||
|
try {
|
||||||
|
boolean success = this.save(gardsResearchReactors);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("反应堆信息添加成功", gardsResearchReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("反应堆信息添加失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("create: " + e.getMessage());
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> deleteById( Integer id) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(id);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("删除成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("删除失败,可能数据不存在");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("deleteById: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新反应堆信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update( GardsResearchReactors gardsResearchReactors) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(gardsResearchReactors);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("数据更新成功", gardsResearchReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("数据更新失败");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("update: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<GardsResearchReactors> queryById( Integer id) {
|
||||||
|
try {
|
||||||
|
GardsResearchReactors nuclearReactors = this.getById(id);
|
||||||
|
if (nuclearReactors != null) {
|
||||||
|
return Result.OK(nuclearReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到数据");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("getById: " + e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageNum
|
||||||
|
* @param pageSize
|
||||||
|
* @param facilityName
|
||||||
|
* @param country
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<IPage<GardsResearchReactors>> page(
|
||||||
|
Integer pageNum,
|
||||||
|
Integer pageSize,
|
||||||
|
String facilityName,
|
||||||
|
String country) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Page<GardsResearchReactors> page = new Page<>(pageNum, pageSize);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<GardsResearchReactors> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (facilityName != null && !facilityName.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsResearchReactors::getFacilityName, facilityName);
|
||||||
|
}
|
||||||
|
if (country != null && !country.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsResearchReactors::getCountry, country);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsResearchReactors::getId);
|
||||||
|
IPage<GardsResearchReactors> pageResult = this.page(page, wrapper);
|
||||||
|
|
||||||
|
return Result.OK(pageResult);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("page: " + e.getMessage());
|
||||||
|
return Result.error("查询失败" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GardsResearchReactors> getByConditions(String facilityName, String country,String reactorType,String status) {
|
public List<GardsResearchReactors> getByConditions(String facilityName, String country,String reactorType,String status) {
|
||||||
LambdaQueryWrapper<GardsResearchReactors> query = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsResearchReactors> query = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (facilityName != null&&!facilityName.trim().isEmpty()) {
|
if (facilityName != null&&!facilityName.trim().isEmpty()) {
|
||||||
query.eq(GardsResearchReactors::getFacilityName, facilityName);
|
query.like(GardsResearchReactors::getFacilityName, facilityName);
|
||||||
}
|
}
|
||||||
if (country != null&&!country.trim().isEmpty()) {
|
if (country != null&&!country.trim().isEmpty()) {
|
||||||
query.eq(GardsResearchReactors::getCountry, country);
|
query.like(GardsResearchReactors::getCountry, country);
|
||||||
}
|
}
|
||||||
if (reactorType != null&&!reactorType.trim().isEmpty()) {
|
if (reactorType != null&&!reactorType.trim().isEmpty()) {
|
||||||
query.eq(GardsResearchReactors::getReactorType, reactorType);
|
query.like(GardsResearchReactors::getReactorType, reactorType);
|
||||||
}
|
}
|
||||||
if (status != null&&!status.trim().isEmpty()) {
|
if (status != null&&!status.trim().isEmpty()) {
|
||||||
query.eq(GardsResearchReactors::getStatus, status);
|
query.like(GardsResearchReactors::getStatus, status);
|
||||||
}
|
}
|
||||||
|
query.orderByDesc(GardsResearchReactors::getId);
|
||||||
return this.list(query);
|
return this.list(query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,18 @@ package org.jeecg.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
import org.jeecg.modules.base.entity.configuration.GardsResearchReactors;
|
||||||
import org.jeecg.modules.base.entity.configuration.GardsStations;
|
import org.jeecg.modules.base.entity.configuration.GardsStations;
|
||||||
import org.jeecg.modules.base.mapper.GardsStationsMapper;
|
import org.jeecg.modules.base.mapper.GardsStationsMapper;
|
||||||
import org.jeecg.service.GardsStationsService;
|
import org.jeecg.service.GardsStationsService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -15,23 +21,142 @@ import java.util.List;
|
||||||
public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, GardsStations> implements GardsStationsService {
|
public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, GardsStations> implements GardsStationsService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> create( GardsStations gardsStations) {
|
||||||
|
try {
|
||||||
|
if (gardsStations.getStationCode().length()>5){
|
||||||
|
return Result.error("添加失败:StationCode 最大长度为5,实际长度是:"+gardsStations.getStationCode().length());
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean success = this.save(gardsStations);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("添加成功", gardsStations);
|
||||||
|
} else {
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("create: " + e.getMessage());
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> deleteById( Integer stationId) {
|
||||||
|
try {
|
||||||
|
boolean success = this.removeById(stationId);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("删除成功");
|
||||||
|
} else {
|
||||||
|
return Result.error("删除失败,可能数据不存在");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("deleteById: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = RuntimeException.class)
|
||||||
|
public Result<?> update(GardsStations gardsStations) {
|
||||||
|
try {
|
||||||
|
boolean success = this.updateById(gardsStations);
|
||||||
|
if (success) {
|
||||||
|
return Result.OK("数据更新成功", gardsStations);
|
||||||
|
} else {
|
||||||
|
return Result.error("数据更新失败");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("update: " + e.getMessage());
|
||||||
|
return Result.error("操作失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<GardsStations> queryById( Integer stationId) {
|
||||||
|
try {
|
||||||
|
GardsStations nuclearReactors = this.getById(stationId);
|
||||||
|
if (nuclearReactors != null) {
|
||||||
|
return Result.OK(nuclearReactors);
|
||||||
|
} else {
|
||||||
|
return Result.error("未找到数据");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("getById: " + e.getMessage());
|
||||||
|
return Result.error("查询失败" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageNum
|
||||||
|
* @param pageSize
|
||||||
|
* @param stationCode
|
||||||
|
* @param countryCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result<IPage<GardsStations>> page(
|
||||||
|
Integer pageNum,
|
||||||
|
Integer pageSize,
|
||||||
|
String stationCode,
|
||||||
|
String countryCode) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Page<GardsStations> page = new Page<>(pageNum, pageSize);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<GardsStations> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (stationCode != null && !stationCode.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsStations::getStationCode, stationCode);
|
||||||
|
}
|
||||||
|
if (countryCode != null && !countryCode.trim().isEmpty()) {
|
||||||
|
wrapper.like(GardsStations::getCountryCode, countryCode);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(GardsStations::getStationId);
|
||||||
|
IPage<GardsStations> pageResult = this.page(page, wrapper);
|
||||||
|
|
||||||
|
return Result.OK(pageResult);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("page: " + e.getMessage());
|
||||||
|
return Result.error("查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GardsStations> getByConditions(String stationCode, String type, String status,String countryCode) {
|
public List<GardsStations> getByConditions(String stationCode, String type, String status,String countryCode) {
|
||||||
LambdaQueryWrapper<GardsStations> query = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsStations> query = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if (stationCode != null&&!stationCode.trim().isEmpty()) {
|
if (stationCode != null&&!stationCode.trim().isEmpty()) {
|
||||||
query.eq(GardsStations::getStationCode, stationCode);
|
query.like(GardsStations::getStationCode, stationCode);
|
||||||
}
|
}
|
||||||
if (type != null&&!type.trim().isEmpty()) {
|
if (type != null&&!type.trim().isEmpty()) {
|
||||||
query.eq(GardsStations::getType, type);
|
query.like(GardsStations::getType, type);
|
||||||
}
|
}
|
||||||
if (status != null&&!status.trim().isEmpty()) {
|
if (status != null&&!status.trim().isEmpty()) {
|
||||||
query.eq(GardsStations::getStatus, status);
|
query.like(GardsStations::getStatus, status);
|
||||||
}
|
}
|
||||||
if (countryCode != null&&!countryCode.trim().isEmpty()) {
|
if (countryCode != null&&!countryCode.trim().isEmpty()) {
|
||||||
query.eq(GardsStations::getCountryCode, countryCode);
|
query.like(GardsStations::getCountryCode, countryCode);
|
||||||
}
|
}
|
||||||
|
query.orderByDesc(GardsStations::getStationId);
|
||||||
return this.list(query);
|
return this.list(query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user