1、绿植租赁
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
package org.dromara.property.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.property.domain.vo.PlantsPlanProductVo;
|
||||
import org.dromara.property.domain.bo.PlantsPlanProductBo;
|
||||
import org.dromara.property.service.IPlantsPlanProductService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案-绿植
|
||||
* 前端访问路由地址为:/property/planProduct
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/planProduct")
|
||||
public class PlantsPlanProductController extends BaseController {
|
||||
|
||||
private final IPlantsPlanProductService plantsPlanProductService;
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-租赁方案-绿植列表
|
||||
*/
|
||||
@SaCheckPermission("property:planProduct:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PlantsPlanProductVo> list(PlantsPlanProductBo bo, PageQuery pageQuery) {
|
||||
return plantsPlanProductService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出绿植租赁-租赁方案-绿植列表
|
||||
*/
|
||||
@SaCheckPermission("property:planProduct:export")
|
||||
@Log(title = "绿植租赁-租赁方案-绿植", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(PlantsPlanProductBo bo, HttpServletResponse response) {
|
||||
List<PlantsPlanProductVo> list = plantsPlanProductService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "绿植租赁-租赁方案-绿植", PlantsPlanProductVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绿植租赁-租赁方案-绿植详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:planProduct:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PlantsPlanProductVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(plantsPlanProductService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-租赁方案-绿植
|
||||
*/
|
||||
@SaCheckPermission("property:planProduct:add")
|
||||
@Log(title = "绿植租赁-租赁方案-绿植", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PlantsPlanProductBo bo) {
|
||||
return toAjax(plantsPlanProductService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-租赁方案-绿植
|
||||
*/
|
||||
@SaCheckPermission("property:planProduct:edit")
|
||||
@Log(title = "绿植租赁-租赁方案-绿植", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PlantsPlanProductBo bo) {
|
||||
return toAjax(plantsPlanProductService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除绿植租赁-租赁方案-绿植
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("property:planProduct:remove")
|
||||
@Log(title = "绿植租赁-租赁方案-绿植", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(plantsPlanProductService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,106 @@
|
||||
package org.dromara.property.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.property.domain.vo.PlantsProductVo;
|
||||
import org.dromara.property.domain.bo.PlantsProductBo;
|
||||
import org.dromara.property.service.IPlantsProductService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 绿植租赁-绿植产品
|
||||
* 前端访问路由地址为:/property/property
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/plantsProduct")
|
||||
public class PlantsProductController extends BaseController {
|
||||
|
||||
private final IPlantsProductService plantsProductService;
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-绿植产品列表
|
||||
*/
|
||||
@SaCheckPermission("property:plantsProduct:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PlantsProductVo> list(PlantsProductBo bo, PageQuery pageQuery) {
|
||||
return plantsProductService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出绿植租赁-绿植产品列表
|
||||
*/
|
||||
@SaCheckPermission("property:plantsProduct:export")
|
||||
@Log(title = "绿植租赁-绿植产品", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(PlantsProductBo bo, HttpServletResponse response) {
|
||||
List<PlantsProductVo> list = plantsProductService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "绿植租赁-绿植产品", PlantsProductVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绿植租赁-绿植产品详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:plantsProduct:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PlantsProductVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(plantsProductService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-绿植产品
|
||||
*/
|
||||
@SaCheckPermission("property:plantsProduct:add")
|
||||
@Log(title = "绿植租赁-绿植产品", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PlantsProductBo bo) {
|
||||
return toAjax(plantsProductService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-绿植产品
|
||||
*/
|
||||
@SaCheckPermission("property:plantsProduct:edit")
|
||||
@Log(title = "绿植租赁-绿植产品", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PlantsProductBo bo) {
|
||||
return toAjax(plantsProductService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除绿植租赁-绿植产品
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("property:plantsProduct:remove")
|
||||
@Log(title = "绿植租赁-绿植产品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(plantsProductService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,106 @@
|
||||
package org.dromara.property.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.property.domain.vo.PlantsRentalPlanVo;
|
||||
import org.dromara.property.domain.bo.PlantsRentalPlanBo;
|
||||
import org.dromara.property.service.IPlantsRentalPlanService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案
|
||||
* 前端访问路由地址为:/property/rentalPlan
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/rentalPlan")
|
||||
public class PlantsRentalPlanController extends BaseController {
|
||||
|
||||
private final IPlantsRentalPlanService plantsRentalPlanService;
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-租赁方案列表
|
||||
*/
|
||||
@SaCheckPermission("property:rentalPlan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PlantsRentalPlanVo> list(PlantsRentalPlanBo bo, PageQuery pageQuery) {
|
||||
return plantsRentalPlanService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出绿植租赁-租赁方案列表
|
||||
*/
|
||||
@SaCheckPermission("property:rentalPlan:export")
|
||||
@Log(title = "绿植租赁-租赁方案", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(PlantsRentalPlanBo bo, HttpServletResponse response) {
|
||||
List<PlantsRentalPlanVo> list = plantsRentalPlanService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "绿植租赁-租赁方案", PlantsRentalPlanVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绿植租赁-租赁方案详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("property:rentalPlan:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<PlantsRentalPlanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(plantsRentalPlanService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-租赁方案
|
||||
*/
|
||||
@SaCheckPermission("property:rentalPlan:add")
|
||||
@Log(title = "绿植租赁-租赁方案", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PlantsRentalPlanBo bo) {
|
||||
return toAjax(plantsRentalPlanService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-租赁方案
|
||||
*/
|
||||
@SaCheckPermission("property:rentalPlan:edit")
|
||||
@Log(title = "绿植租赁-租赁方案", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PlantsRentalPlanBo bo) {
|
||||
return toAjax(plantsRentalPlanService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除绿植租赁-租赁方案
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("property:rentalPlan:remove")
|
||||
@Log(title = "绿植租赁-租赁方案", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(plantsRentalPlanService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案-绿植对象 plants_plan_product
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("plants_plan_product")
|
||||
public class PlantsPlanProduct extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租赁方案id
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 绿植产品id
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 绿植租赁-绿植产品对象 plants_product
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("plants_product")
|
||||
public class PlantsProduct extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String plantCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String plantName;
|
||||
|
||||
/**
|
||||
* 产品分类
|
||||
*/
|
||||
private Long plantType;
|
||||
|
||||
/**
|
||||
* 产品图片
|
||||
*/
|
||||
private String imgPath;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 租金
|
||||
*/
|
||||
private Long rent;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Long inventory;
|
||||
|
||||
/**
|
||||
* 状态(0下架 1上架 )
|
||||
*/
|
||||
private Long state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案对象 plants_rental_plan
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("plants_rental_plan")
|
||||
public class PlantsRentalPlan extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 方案名称
|
||||
*/
|
||||
private String planName;
|
||||
|
||||
/**
|
||||
* 租赁周期
|
||||
*/
|
||||
private Long rentalPeriod;
|
||||
|
||||
/**
|
||||
* 适用场景
|
||||
*/
|
||||
private String scene;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long price;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Long state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.PlantsPlanProduct;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案-绿植业务对象 plants_plan_product
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PlantsPlanProduct.class, reverseConvertGenerate = false)
|
||||
public class PlantsPlanProductBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租赁方案id
|
||||
*/
|
||||
@NotNull(message = "租赁方案id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 绿植产品id
|
||||
*/
|
||||
@NotNull(message = "绿植产品id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long productId;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.PlantsProduct;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 绿植租赁-绿植产品业务对象 plants_product
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PlantsProduct.class, reverseConvertGenerate = false)
|
||||
public class PlantsProductBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@NotBlank(message = "产品编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String plantCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "产品名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String plantName;
|
||||
|
||||
/**
|
||||
* 产品分类
|
||||
*/
|
||||
@NotNull(message = "产品分类不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long plantType;
|
||||
|
||||
/**
|
||||
* 产品图片
|
||||
*/
|
||||
private String imgPath;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@NotBlank(message = "规格不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 租金
|
||||
*/
|
||||
@NotNull(message = "租金不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long rent;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@NotNull(message = "库存数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long inventory;
|
||||
|
||||
/**
|
||||
* 状态(0下架 1上架 )
|
||||
*/
|
||||
@NotNull(message = "状态(0下架 1上架 )不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,64 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.PlantsRentalPlan;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案业务对象 plants_rental_plan
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PlantsRentalPlan.class, reverseConvertGenerate = false)
|
||||
public class PlantsRentalPlanBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 方案名称
|
||||
*/
|
||||
@NotBlank(message = "方案名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String planName;
|
||||
|
||||
/**
|
||||
* 租赁周期
|
||||
*/
|
||||
@NotNull(message = "租赁周期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long rentalPeriod;
|
||||
|
||||
/**
|
||||
* 适用场景
|
||||
*/
|
||||
@NotBlank(message = "适用场景不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String scene;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long price;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import org.dromara.property.domain.PlantsPlanProduct;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案-绿植视图对象 plants_plan_product
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PlantsPlanProduct.class)
|
||||
public class PlantsPlanProductVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租赁方案id
|
||||
*/
|
||||
@ExcelProperty(value = "租赁方案id")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 绿植产品id
|
||||
*/
|
||||
@ExcelProperty(value = "绿植产品id")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,99 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import org.dromara.property.domain.PlantsProduct;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 绿植租赁-绿植产品视图对象 plants_product
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PlantsProduct.class)
|
||||
public class PlantsProductVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@ExcelProperty(value = "产品编号")
|
||||
private String plantCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@ExcelProperty(value = "产品名称")
|
||||
private String plantName;
|
||||
|
||||
/**
|
||||
* 产品分类
|
||||
*/
|
||||
@ExcelProperty(value = "产品分类")
|
||||
private Long plantType;
|
||||
|
||||
/**
|
||||
* 产品图片
|
||||
*/
|
||||
@ExcelProperty(value = "产品图片")
|
||||
private String imgPath;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 租金
|
||||
*/
|
||||
@ExcelProperty(value = "租金")
|
||||
private Long rent;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@ExcelProperty(value = "库存数量")
|
||||
private Long inventory;
|
||||
|
||||
/**
|
||||
* 状态(0下架 1上架 )
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "product_management_status")
|
||||
private Long state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,80 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import org.dromara.property.domain.PlantsRentalPlan;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案视图对象 plants_rental_plan
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PlantsRentalPlan.class)
|
||||
public class PlantsRentalPlanVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 方案名称
|
||||
*/
|
||||
@ExcelProperty(value = "方案名称")
|
||||
private String planName;
|
||||
|
||||
/**
|
||||
* 租赁周期
|
||||
*/
|
||||
@ExcelProperty(value = "租赁周期")
|
||||
private Long rentalPeriod;
|
||||
|
||||
/**
|
||||
* 适用场景
|
||||
*/
|
||||
@ExcelProperty(value = "适用场景")
|
||||
private String scene;
|
||||
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ExcelProperty(value = "价格")
|
||||
private Long price;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "wy_kg")
|
||||
private Long state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.dromara.property.domain.PlantsPlanProduct;
|
||||
import org.dromara.property.domain.vo.PlantsPlanProductVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案-绿植Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface PlantsPlanProductMapper extends BaseMapperPlus<PlantsPlanProduct, PlantsPlanProductVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.dromara.property.domain.PlantsProduct;
|
||||
import org.dromara.property.domain.vo.PlantsProductVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 绿植租赁-绿植产品Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface PlantsProductMapper extends BaseMapperPlus<PlantsProduct, PlantsProductVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.dromara.property.domain.PlantsRentalPlan;
|
||||
import org.dromara.property.domain.vo.PlantsRentalPlanVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface PlantsRentalPlanMapper extends BaseMapperPlus<PlantsRentalPlan, PlantsRentalPlanVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.PlantsPlanProduct;
|
||||
import org.dromara.property.domain.vo.PlantsPlanProductVo;
|
||||
import org.dromara.property.domain.bo.PlantsPlanProductBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案-绿植Service接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface IPlantsPlanProductService {
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-租赁方案-绿植
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 绿植租赁-租赁方案-绿植
|
||||
*/
|
||||
PlantsPlanProductVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询绿植租赁-租赁方案-绿植列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 绿植租赁-租赁方案-绿植分页列表
|
||||
*/
|
||||
TableDataInfo<PlantsPlanProductVo> queryPageList(PlantsPlanProductBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的绿植租赁-租赁方案-绿植列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 绿植租赁-租赁方案-绿植列表
|
||||
*/
|
||||
List<PlantsPlanProductVo> queryList(PlantsPlanProductBo bo);
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-租赁方案-绿植
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案-绿植
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(PlantsPlanProductBo bo);
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-租赁方案-绿植
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案-绿植
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(PlantsPlanProductBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除绿植租赁-租赁方案-绿植信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.PlantsProduct;
|
||||
import org.dromara.property.domain.vo.PlantsProductVo;
|
||||
import org.dromara.property.domain.bo.PlantsProductBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 绿植租赁-绿植产品Service接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface IPlantsProductService {
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-绿植产品
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 绿植租赁-绿植产品
|
||||
*/
|
||||
PlantsProductVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询绿植租赁-绿植产品列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 绿植租赁-绿植产品分页列表
|
||||
*/
|
||||
TableDataInfo<PlantsProductVo> queryPageList(PlantsProductBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的绿植租赁-绿植产品列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 绿植租赁-绿植产品列表
|
||||
*/
|
||||
List<PlantsProductVo> queryList(PlantsProductBo bo);
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-绿植产品
|
||||
*
|
||||
* @param bo 绿植租赁-绿植产品
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(PlantsProductBo bo);
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-绿植产品
|
||||
*
|
||||
* @param bo 绿植租赁-绿植产品
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(PlantsProductBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除绿植租赁-绿植产品信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.PlantsRentalPlan;
|
||||
import org.dromara.property.domain.vo.PlantsRentalPlanVo;
|
||||
import org.dromara.property.domain.bo.PlantsRentalPlanBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案Service接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface IPlantsRentalPlanService {
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-租赁方案
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 绿植租赁-租赁方案
|
||||
*/
|
||||
PlantsRentalPlanVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询绿植租赁-租赁方案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 绿植租赁-租赁方案分页列表
|
||||
*/
|
||||
TableDataInfo<PlantsRentalPlanVo> queryPageList(PlantsRentalPlanBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的绿植租赁-租赁方案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 绿植租赁-租赁方案列表
|
||||
*/
|
||||
List<PlantsRentalPlanVo> queryList(PlantsRentalPlanBo bo);
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-租赁方案
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(PlantsRentalPlanBo bo);
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-租赁方案
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(PlantsRentalPlanBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除绿植租赁-租赁方案信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@@ -0,0 +1,133 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.PlantsPlanProductBo;
|
||||
import org.dromara.property.domain.vo.PlantsPlanProductVo;
|
||||
import org.dromara.property.domain.PlantsPlanProduct;
|
||||
import org.dromara.property.mapper.PlantsPlanProductMapper;
|
||||
import org.dromara.property.service.IPlantsPlanProductService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案-绿植Service业务层处理
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class PlantsPlanProductServiceImpl implements IPlantsPlanProductService {
|
||||
|
||||
private final PlantsPlanProductMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-租赁方案-绿植
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 绿植租赁-租赁方案-绿植
|
||||
*/
|
||||
@Override
|
||||
public PlantsPlanProductVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询绿植租赁-租赁方案-绿植列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 绿植租赁-租赁方案-绿植分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<PlantsPlanProductVo> queryPageList(PlantsPlanProductBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<PlantsPlanProduct> lqw = buildQueryWrapper(bo);
|
||||
Page<PlantsPlanProductVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的绿植租赁-租赁方案-绿植列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 绿植租赁-租赁方案-绿植列表
|
||||
*/
|
||||
@Override
|
||||
public List<PlantsPlanProductVo> queryList(PlantsPlanProductBo bo) {
|
||||
LambdaQueryWrapper<PlantsPlanProduct> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<PlantsPlanProduct> buildQueryWrapper(PlantsPlanProductBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<PlantsPlanProduct> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(PlantsPlanProduct::getId);
|
||||
lqw.eq(bo.getPlanId() != null, PlantsPlanProduct::getPlanId, bo.getPlanId());
|
||||
lqw.eq(bo.getProductId() != null, PlantsPlanProduct::getProductId, bo.getProductId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-租赁方案-绿植
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案-绿植
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(PlantsPlanProductBo bo) {
|
||||
PlantsPlanProduct add = MapstructUtils.convert(bo, PlantsPlanProduct.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-租赁方案-绿植
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案-绿植
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(PlantsPlanProductBo bo) {
|
||||
PlantsPlanProduct update = MapstructUtils.convert(bo, PlantsPlanProduct.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(PlantsPlanProduct entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除绿植租赁-租赁方案-绿植信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,139 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.PlantsProductBo;
|
||||
import org.dromara.property.domain.vo.PlantsProductVo;
|
||||
import org.dromara.property.domain.PlantsProduct;
|
||||
import org.dromara.property.mapper.PlantsProductMapper;
|
||||
import org.dromara.property.service.IPlantsProductService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 绿植租赁-绿植产品Service业务层处理
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class PlantsProductServiceImpl implements IPlantsProductService {
|
||||
|
||||
private final PlantsProductMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-绿植产品
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 绿植租赁-绿植产品
|
||||
*/
|
||||
@Override
|
||||
public PlantsProductVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询绿植租赁-绿植产品列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 绿植租赁-绿植产品分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<PlantsProductVo> queryPageList(PlantsProductBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<PlantsProduct> lqw = buildQueryWrapper(bo);
|
||||
Page<PlantsProductVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的绿植租赁-绿植产品列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 绿植租赁-绿植产品列表
|
||||
*/
|
||||
@Override
|
||||
public List<PlantsProductVo> queryList(PlantsProductBo bo) {
|
||||
LambdaQueryWrapper<PlantsProduct> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<PlantsProduct> buildQueryWrapper(PlantsProductBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<PlantsProduct> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(PlantsProduct::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlantCode()), PlantsProduct::getPlantCode, bo.getPlantCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getPlantName()), PlantsProduct::getPlantName, bo.getPlantName());
|
||||
lqw.eq(bo.getPlantType() != null, PlantsProduct::getPlantType, bo.getPlantType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getImgPath()), PlantsProduct::getImgPath, bo.getImgPath());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecification()), PlantsProduct::getSpecification, bo.getSpecification());
|
||||
lqw.eq(bo.getRent() != null, PlantsProduct::getRent, bo.getRent());
|
||||
lqw.eq(bo.getInventory() != null, PlantsProduct::getInventory, bo.getInventory());
|
||||
lqw.eq(bo.getState() != null, PlantsProduct::getState, bo.getState());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-绿植产品
|
||||
*
|
||||
* @param bo 绿植租赁-绿植产品
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(PlantsProductBo bo) {
|
||||
PlantsProduct add = MapstructUtils.convert(bo, PlantsProduct.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-绿植产品
|
||||
*
|
||||
* @param bo 绿植租赁-绿植产品
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(PlantsProductBo bo) {
|
||||
PlantsProduct update = MapstructUtils.convert(bo, PlantsProduct.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(PlantsProduct entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除绿植租赁-绿植产品信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,137 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.PlantsRentalPlanBo;
|
||||
import org.dromara.property.domain.vo.PlantsRentalPlanVo;
|
||||
import org.dromara.property.domain.PlantsRentalPlan;
|
||||
import org.dromara.property.mapper.PlantsRentalPlanMapper;
|
||||
import org.dromara.property.service.IPlantsRentalPlanService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 绿植租赁-租赁方案Service业务层处理
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class PlantsRentalPlanServiceImpl implements IPlantsRentalPlanService {
|
||||
|
||||
private final PlantsRentalPlanMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-租赁方案
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 绿植租赁-租赁方案
|
||||
*/
|
||||
@Override
|
||||
public PlantsRentalPlanVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询绿植租赁-租赁方案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 绿植租赁-租赁方案分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<PlantsRentalPlanVo> queryPageList(PlantsRentalPlanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<PlantsRentalPlan> lqw = buildQueryWrapper(bo);
|
||||
Page<PlantsRentalPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的绿植租赁-租赁方案列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 绿植租赁-租赁方案列表
|
||||
*/
|
||||
@Override
|
||||
public List<PlantsRentalPlanVo> queryList(PlantsRentalPlanBo bo) {
|
||||
LambdaQueryWrapper<PlantsRentalPlan> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<PlantsRentalPlan> buildQueryWrapper(PlantsRentalPlanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<PlantsRentalPlan> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(PlantsRentalPlan::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getPlanName()), PlantsRentalPlan::getPlanName, bo.getPlanName());
|
||||
lqw.eq(bo.getRentalPeriod() != null, PlantsRentalPlan::getRentalPeriod, bo.getRentalPeriod());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getScene()), PlantsRentalPlan::getScene, bo.getScene());
|
||||
lqw.eq(bo.getPrice() != null, PlantsRentalPlan::getPrice, bo.getPrice());
|
||||
lqw.eq(bo.getState() != null, PlantsRentalPlan::getState, bo.getState());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), PlantsRentalPlan::getRemarks, bo.getRemarks());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增绿植租赁-租赁方案
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(PlantsRentalPlanBo bo) {
|
||||
PlantsRentalPlan add = MapstructUtils.convert(bo, PlantsRentalPlan.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绿植租赁-租赁方案
|
||||
*
|
||||
* @param bo 绿植租赁-租赁方案
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(PlantsRentalPlanBo bo) {
|
||||
PlantsRentalPlan update = MapstructUtils.convert(bo, PlantsRentalPlan.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(PlantsRentalPlan entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除绿植租赁-租赁方案信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.property.mapper.PlantsPlanProductMapper">
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.property.mapper.PlantsProductMapper">
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.property.mapper.PlantsRentalPlanMapper">
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user