|
|
@@ -60,6 +60,32 @@ public class DbBottleTypeController extends AbstractController {
|
|
|
return ResultData.fail("操作失败");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * app-添加气瓶类型
|
|
|
+ *
|
|
|
+ * @param dbBottleTypeBo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "app-添加气瓶类型", notes = "参数说明:gasName 气体名称,level 级别,size 规格,gasComposition 气体成分 ")
|
|
|
+ @Log(title = "app-添加气瓶类型", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping(value = "/appAdd")
|
|
|
+ public ResultData appAdd(@RequestBody DbBottleTypeBo dbBottleTypeBo) {
|
|
|
+ //参数检查
|
|
|
+ paramCheck.notNull(dbBottleTypeBo).strNotEmpty(dbBottleTypeBo.getGasName()).notNull(dbBottleTypeBo.getLevel()).notNull(dbBottleTypeBo.getSize());
|
|
|
+ //验证是否重复
|
|
|
+ long count = dbBottleTypeService.count(new LambdaQueryWrapper<DbBottleType>().eq(DbBottleType::getGasName, dbBottleTypeBo.getGasName()).eq(DbBottleType::getLevel, dbBottleTypeBo.getLevel()).eq(DbBottleType::getSize, dbBottleTypeBo.getSize()));
|
|
|
+ if (count > 0) {
|
|
|
+ return ResultData.fail("已存在相同气瓶类型");
|
|
|
+ }
|
|
|
+ DbBottleType dbBottle = new DbBottleType();
|
|
|
+ BeanUtils.copyProperties(dbBottleTypeBo, dbBottle);
|
|
|
+ dbBottle.setIsDeleted(Boolean.FALSE);
|
|
|
+ if (dbBottleTypeService.save(dbBottle)) {
|
|
|
+ return ResultData.success("操作成功");
|
|
|
+ }
|
|
|
+ return ResultData.fail("操作失败");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 更新气瓶类型
|
|
|
@@ -88,6 +114,31 @@ public class DbBottleTypeController extends AbstractController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * app-更新气瓶类型
|
|
|
+ *
|
|
|
+ * @Param [dbBottleBo]
|
|
|
+ * @Return com.zd.model.domain.ResultData
|
|
|
+ **/
|
|
|
+ @ApiOperation(value = "app-更新气瓶类型", notes = "参数说明:id 必填,gasName 气体名称,level 级别,size 规格,gasComposition 气体成分 ")
|
|
|
+ @Log(title = "app-更新气瓶类型", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping(value = "/appUpdate")
|
|
|
+ public ResultData appUpdate(@RequestBody DbBottleTypeBo dbBottleTypeBo) {
|
|
|
+ //参数检查
|
|
|
+ paramCheck.notNull(dbBottleTypeBo).notNull(dbBottleTypeBo.getId()).strNotEmpty(dbBottleTypeBo.getGasName()).notNull(dbBottleTypeBo.getLevel()).notNull(dbBottleTypeBo.getSize());
|
|
|
+ //验证是否重复
|
|
|
+ long count = dbBottleTypeService.count(new LambdaQueryWrapper<DbBottleType>().ne(DbBottleType::getId, dbBottleTypeBo.getId()).eq(DbBottleType::getGasName, dbBottleTypeBo.getGasName()).eq(DbBottleType::getLevel, dbBottleTypeBo.getLevel()).eq(DbBottleType::getSize, dbBottleTypeBo.getSize()));
|
|
|
+ if (count > 0) {
|
|
|
+ return ResultData.fail("已存在相同气瓶类型");
|
|
|
+ }
|
|
|
+ DbBottleType dbBottle = new DbBottleType();
|
|
|
+ BeanUtils.copyProperties(dbBottleTypeBo, dbBottle);
|
|
|
+ if (dbBottleTypeService.saveOrUpdate(dbBottle)) {
|
|
|
+ return ResultData.success("操作成功");
|
|
|
+ }
|
|
|
+ return ResultData.fail("操作失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 通过ID获取气瓶类型详情
|
|
|
*
|
|
|
* @param id
|
|
|
@@ -103,6 +154,20 @@ public class DbBottleTypeController extends AbstractController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * app-通过ID获取气瓶类型详情
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "app-通过ID获取气瓶类型详情", notes = "参数说明:id 必填")
|
|
|
+ @GetMapping(value = "/appFindById")
|
|
|
+ public ResultData appFind(@RequestParam("id") Long id) {
|
|
|
+ paramCheck.notNull(id);
|
|
|
+ DbBottleType dbBottle = dbBottleTypeService.getById(id);
|
|
|
+ return ResultData.success(dbBottle);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取气瓶类型list
|
|
|
*
|
|
|
* @param dbBottleTypeBo
|
|
|
@@ -125,6 +190,27 @@ public class DbBottleTypeController extends AbstractController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * app-获取气瓶类型list
|
|
|
+ *
|
|
|
+ * @param dbBottleTypeBo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "app-获取气瓶类型list", notes = "参数说明:searchValue 关键字")
|
|
|
+ @PostMapping(value = "/appList")
|
|
|
+ public ResultData appList(@RequestBody DbBottleTypeBo dbBottleTypeBo) {
|
|
|
+ //查询条件
|
|
|
+ LambdaQueryWrapper<DbBottleType> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ //gasName条件
|
|
|
+ if (StringUtils.isNotBlank(dbBottleTypeBo.getSearchValue())) {
|
|
|
+ queryWrapper.like(DbBottleType::getGasName, dbBottleTypeBo.getSearchValue());
|
|
|
+ }
|
|
|
+ //过滤物理删除数据及倒叙
|
|
|
+ queryWrapper.eq(DbBottleType::getIsDeleted, Boolean.FALSE).orderByDesc(DbBottleType::getId);
|
|
|
+ IPage<DbBottleType> page = dbBottleTypeService.page(PageUtil.getQuery(dbBottleTypeBo.getPageNum(), dbBottleTypeBo.getPageSize()), queryWrapper);
|
|
|
+ return ResultData.success(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 通过Id删除气瓶类型
|
|
|
*
|
|
|
* @param dbBottleTypeBo
|
|
|
@@ -143,4 +229,23 @@ public class DbBottleTypeController extends AbstractController {
|
|
|
return ResultData.fail("操作失败");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * app-通过Id删除气瓶类型
|
|
|
+ *
|
|
|
+ * @param dbBottleTypeBo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "app-通过Id删除气瓶类型", notes = "参数说明:id 必填")
|
|
|
+ @Log(title = "app-通过Id删除气瓶类型", businessType = BusinessType.DELETE)
|
|
|
+ @PreAuthorize(hasPermi = PerPrefix.DB_BOTTLETYPE + PerFun.REMOVE)
|
|
|
+ @PostMapping(value = "/appDelete")
|
|
|
+ public ResultData appDelete(@RequestBody DbBottleTypeBo dbBottleTypeBo) {
|
|
|
+ paramCheck.notNull(dbBottleTypeBo).notNull(dbBottleTypeBo.getId());
|
|
|
+ boolean bool = dbBottleTypeService.removeById(dbBottleTypeBo.getId());
|
|
|
+ if (bool) {
|
|
|
+ return ResultData.success("操作成功");
|
|
|
+ }
|
|
|
+ return ResultData.fail("操作失败");
|
|
|
+ }
|
|
|
+
|
|
|
}
|