智慧农业后台管理
Administrator
2022-05-18 5d0e5ef52e8ebc0c327e6ac4ce0746da8c167c7b
新增采收记录curd,农产品库存curd接口
3 files renamed
1 files modified
14 files added
675 ■■■■■ changed files
src/main/java/org/springblade/modules/develop/mapper/RecoveryService.xml patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/controller/FarmPlantController.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/controller/FarmProductStockController.java 109 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/entity/FarmProductStock.java 75 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/service/FarmProductStockService.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/service/impl/FarmProductStockServiceImpl.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/farmplant/vo/FarmProductStockVO.java 16 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/controller/RecoveryController.java 184 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/entity/Recovery.java 84 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.java 27 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/service/RecoveryService.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/service/impl/RecoveryServiceImpl.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recovery/vo/RecoveryVO.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/mapper/RecoveryService.xml patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/RecoveryService.xml patch | view | raw | blame | history
src/main/java/org/springblade/modules/develop/mapper/RecoveryService.xml
src/main/java/org/springblade/modules/farmplant/controller/FarmPlantController.java
@@ -109,7 +109,6 @@
                record.setType("11");
            }
            record.setLandId(farmPlant.getLandId());
            record.setTime(farmPlant.getTransplanTime());
            record.setOperator(farmPlant.getCreateUser());
            record.setRemarks("品种: "+farmPlant.getVarieties());
            //新增
src/main/java/org/springblade/modules/farmplant/controller/FarmProductStockController.java
New file
@@ -0,0 +1,109 @@
package org.springblade.modules.farmplant.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.farmplant.entity.FarmProductStock;
import org.springblade.modules.farmplant.service.FarmProductStockService;
import org.springblade.modules.farmplant.vo.FarmProductStockVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
/**
 * 农产品库存控制器
 * @since 2022-05-18
 * @author zhongrj
 */
@RestController
@AllArgsConstructor
@RequestMapping("/farmProductStock")
public class FarmProductStockController extends BladeController {
    private final FarmProductStockService farmProductStockService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入farmProductStock")
    public R<FarmProductStock> detail(FarmProductStock farmProductStock) {
        FarmProductStock detail = farmProductStockService.getOne(Condition.getQueryWrapper(farmProductStock));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入farmProductStock")
    public R<IPage<FarmProductStock>> list(FarmProductStock farmProductStock, Query query) {
        IPage<FarmProductStock> pages = farmProductStockService.page(Condition.getPage(query), Condition.getQueryWrapper(farmProductStock));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入farmProductStock")
    public R<IPage<FarmProductStockVO>> page(FarmProductStockVO farmProductStock, Query query) {
        IPage<FarmProductStockVO> pages = farmProductStockService.selectFarmProductStockPage(Condition.getPage(query), farmProductStock);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入farmProductStock")
    public R save(@Valid @RequestBody FarmProductStock farmProductStock) {
        farmProductStock.setCreateTime(new Date());
        return R.status(farmProductStockService.save(farmProductStock));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入farmProductStock")
    public R update(@Valid @RequestBody FarmProductStock farmProductStock) {
        //更新并返回
        return R.status(farmProductStockService.updateById(farmProductStock));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入farmProductStock")
    public R submit(@Valid @RequestBody FarmProductStock farmProductStock) {
        return R.status(farmProductStockService.saveOrUpdate(farmProductStock));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(farmProductStockService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/farmplant/entity/FarmProductStock.java
New file
@@ -0,0 +1,75 @@
package org.springblade.modules.farmplant.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * 农产品库存表实体类
 * @since 2022-05-18
 * @author zhongrj
 */
@Data
@TableName("sys_farm_product_stock")
public class FarmProductStock implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    /**
     * 品种id
     */
    private Integer strainId;
    /**
     * 采收重量
     */
    private String weight;
    /**
     * 产品等级(0:一等品 1:二等品 2:三等品 3:四等品4:五等品)
     */
    private String leaves;
    /**
     * 采收时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
    /**
     * 操作人(用户id)
     */
    private String operator;
    /**
     * 备注
     */
    private String remark;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 种植记录id
     */
    private Integer farmPlantId;
}
src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.java
New file
@@ -0,0 +1,27 @@
package org.springblade.modules.farmplant.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.farmplant.entity.FarmProductStock;
import org.springblade.modules.farmplant.vo.FarmProductStockVO;
import java.util.List;
/**
 *  农产品库存Mapper 接口
 * @since 2022-05-18
 * @author zhongrj
 */
public interface FarmProductStockMapper extends BaseMapper<FarmProductStock> {
    /**
     * 自定义分页
     *
     * @param page
     * @param farmProductStock
     * @return
     */
    List<FarmProductStockVO> selectFarmProductStockPage(@Param("page") IPage page, @Param("farmProductStock") FarmProductStockVO farmProductStock);
}
src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml
New file
@@ -0,0 +1,9 @@
<?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.springblade.modules.farmplant.mapper.FarmProductStockMapper">
    <!--自定义查询农产品库存分页数据-->
    <select id="selectFarmProductStockPage" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO">
        select * from sys_farm_product_stock
    </select>
</mapper>
src/main/java/org/springblade/modules/farmplant/service/FarmProductStockService.java
New file
@@ -0,0 +1,24 @@
package org.springblade.modules.farmplant.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.farmplant.entity.FarmProductStock;
import org.springblade.modules.farmplant.vo.FarmProductStockVO;
/**
 * 农产品库存服务类
 * @since 2022-05-18
 * @author zhongrj
 */
public interface FarmProductStockService extends IService<FarmProductStock> {
    /**
     * 自定义分页
     *
     * @param page
     * @param farmProductStock
     * @return
     */
    IPage<FarmProductStockVO> selectFarmProductStockPage(IPage<FarmProductStockVO> page, FarmProductStockVO farmProductStock);
}
src/main/java/org/springblade/modules/farmplant/service/impl/FarmProductStockServiceImpl.java
New file
@@ -0,0 +1,28 @@
package org.springblade.modules.farmplant.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.farmplant.entity.FarmProductStock;
import org.springblade.modules.farmplant.mapper.FarmProductStockMapper;
import org.springblade.modules.farmplant.service.FarmProductStockService;
import org.springblade.modules.farmplant.vo.FarmProductStockVO;
import org.springframework.stereotype.Service;
/**
 * 农产品库存服务实现类
 * @since 2022-05-18
 * @author zhongrj
 */
@Service
public class FarmProductStockServiceImpl extends ServiceImpl<FarmProductStockMapper, FarmProductStock> implements FarmProductStockService {
    /**
     * 自定义分页
     * @param page
     * @param farmProductStock
     * @return
     */
    @Override
    public IPage<FarmProductStockVO> selectFarmProductStockPage(IPage<FarmProductStockVO> page, FarmProductStockVO farmProductStock) {
        return page.setRecords(baseMapper.selectFarmProductStockPage(page, farmProductStock));
    }
}
src/main/java/org/springblade/modules/farmplant/vo/FarmProductStockVO.java
New file
@@ -0,0 +1,16 @@
package org.springblade.modules.farmplant.vo;
import lombok.Data;
import org.springblade.modules.farmplant.entity.FarmProductStock;
import org.springblade.modules.recovery.entity.Recovery;
/**
 * 农产品库存VO
 * @since 2022-05-18
 * @author zhongrj
 */
@Data
public class FarmProductStockVO extends FarmProductStock {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/recovery/controller/RecoveryController.java
New file
@@ -0,0 +1,184 @@
package org.springblade.modules.recovery.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.farm.entity.Farm;
import org.springblade.modules.farm.entity.FarmingRecord;
import org.springblade.modules.farm.service.FarmingRecordService;
import org.springblade.modules.farmplant.entity.FarmProductStock;
import org.springblade.modules.farmplant.entity.Strain;
import org.springblade.modules.farmplant.service.FarmProductStockService;
import org.springblade.modules.farmplant.service.StrainService;
import org.springblade.modules.recovery.entity.Recovery;
import org.springblade.modules.recovery.service.RecoveryService;
import org.springblade.modules.recovery.vo.RecoveryVO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 农事记录控制器
 * @since 2022-05-18
 * @author zhongrj
 */
@RestController
@AllArgsConstructor
@RequestMapping("/recovery")
public class RecoveryController extends BladeController {
    private final RecoveryService recoveryService;
    private final FarmingRecordService farmingRecordService;
    private final FarmProductStockService farmProductStockService;
    private final StrainService strainService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入recovery")
    public R<Recovery> detail(Recovery recovery) {
        Recovery detail = recoveryService.getOne(Condition.getQueryWrapper(recovery));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入recovery")
    public R<IPage<Recovery>> list(Recovery recovery, Query query) {
        IPage<Recovery> pages = recoveryService.page(Condition.getPage(query), Condition.getQueryWrapper(recovery));
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入recovery")
    public R<IPage<RecoveryVO>> page(RecoveryVO recovery, Query query) {
        IPage<RecoveryVO> pages = recoveryService.selectRecoveryPage(Condition.getPage(query), recovery);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入recovery")
    @Transactional(rollbackFor = Exception.class)
    public R save(@Valid @RequestBody Recovery recovery) {
        recovery.setCreateTime(new Date());
        boolean save = recoveryService.save(recovery);
        if (save){
            //同时生成农事记录和库存记录
            FarmingRecord record = new FarmingRecord();
            record.setCreateTime(new Date());
            record.setJobWay(recovery.getJobWay());
            record.setTime(recovery.getTime());
            //采收
            record.setType("12");
            record.setLandId(recovery.getLandId());
            record.setOperator(recovery.getOperator());
            Strain strain = strainService.getById(recovery.getStrainId());
            record.setRemarks("品种: "+strain.getStrainName() +", 重量:"+recovery.getWeight());
            //新增
            farmingRecordService.save(record);
            //库存
            //先查询是否有该农产品的库存
            FarmProductStock stock = new FarmProductStock();
            stock.setFarmPlantId(recovery.getFarmPlantId());
            stock.setStrainId(recovery.getStrainId());
            FarmProductStock stock1 = farmProductStockService.getOne(new QueryWrapper<>(stock));
            if (null!=stock1) {
                //更新库存
                //计算库存
                double old = Double.parseDouble(stock1.getWeight());
                double now = Double.parseDouble(recovery.getWeight());
                double addNum = add(old, now);
                stock1.setWeight(String.valueOf(addNum));
                //更新
                farmProductStockService.updateById(stock1);
            }else {
                //新增库存
                FarmProductStock productStock = new FarmProductStock();
                productStock.setCreateTime(new Date());
                productStock.setLeaves(recovery.getLeaves());
                productStock.setOperator(recovery.getOperator());
                productStock.setTime(recovery.getTime());
                productStock.setStrainId(recovery.getStrainId());
                productStock.setWeight(recovery.getWeight());
                productStock.setFarmPlantId(recovery.getFarmPlantId());
                //新增操作
                farmProductStockService.save(productStock);
            }
        }
        return R.status(save);
    }
    /**
     * double 相加
     * @param d1
     * @param d2
     * @return
     */
    private double add(double d1, double d2){
        // 进行加法运算
        BigDecimal b1 = new BigDecimal(d1);
        BigDecimal b2 = new BigDecimal(d2);
        return b1.add(b2).doubleValue();
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入recovery")
    public R update(@Valid @RequestBody Recovery recovery) {
        //更新并返回
        return R.status(recoveryService.updateById(recovery));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入recovery")
    public R submit(@Valid @RequestBody Recovery recovery) {
        return R.status(recoveryService.saveOrUpdate(recovery));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(recoveryService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/recovery/entity/Recovery.java
New file
@@ -0,0 +1,84 @@
package org.springblade.modules.recovery.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * 采收记录表实体类
 * @since 2022-05-18
 * @author zhongrj
 */
@Data
@TableName("sys_recovery")
public class Recovery implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    /**
     * 种植记录id
     */
    private Integer farmPlantId;
    /**
     * 品种id
     */
    private Integer strainId;
    /**
     * 土地id
     */
    private String landId;
    /**
     * 采收重量
     */
    private String weight;
    /**
     * 产品等级(0:一等品 1:二等品 2:三等品 3:四等品4:五等品)
     */
    private String leaves;
    /**
     * 作业方式(0:人工 1:机械)
     */
    private String jobWay;
    /**
     * 采收时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
    /**
     * 操作人(用户id)
     */
    private String operator;
    /**
     * 备注
     */
    private String remark;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.java
New file
@@ -0,0 +1,27 @@
package org.springblade.modules.recovery.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.recovery.entity.Recovery;
import org.springblade.modules.recovery.vo.RecoveryVO;
import java.util.List;
/**
 *  采收记录Mapper 接口
 * @since 2022-05-18
 * @author zhongrj
 */
public interface RecoveryMapper extends BaseMapper<Recovery> {
    /**
     * 自定义分页
     *
     * @param page
     * @param recovery
     * @return
     */
    List<RecoveryVO> selectRecoveryPage(@Param("page") IPage page, @Param("recovery") RecoveryVO recovery);
}
src/main/java/org/springblade/modules/recovery/mapper/RecoveryMapper.xml
New file
@@ -0,0 +1,20 @@
<?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.springblade.modules.recovery.mapper.RecoveryMapper">
    <!--自定义查询采收记录分页数据-->
    <select id="selectRecoveryPage" resultType="org.springblade.modules.recovery.vo.RecoveryVO">
        select sfr.*,sl.land_name landName from sys_recovery sr
        left join sys_land sl on sl.id = sr.land_id
        where 1=1
        <if test="recovery.landId!=null and recovery.landId!=''">
            and sr.land_id = #{recovery.landId}
        </if>
        <if test="recovery.jobWay!=null and recovery.jobWay!=''">
            and sr.job_way = #{recovery.jobWay}
        </if>
        <if test="recovery.operator!=null and recovery.operator!=''">
            and sr.operator = #{recovery.operator}
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/recovery/service/RecoveryService.java
New file
@@ -0,0 +1,24 @@
package org.springblade.modules.recovery.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.recovery.entity.Recovery;
import org.springblade.modules.recovery.vo.RecoveryVO;
/**
 * 采收记录服务类
 * @since 2022-05-18
 * @author zhongrj
 */
public interface RecoveryService extends IService<Recovery> {
    /**
     * 自定义分页
     *
     * @param page
     * @param recovery
     * @return
     */
    IPage<RecoveryVO> selectRecoveryPage(IPage<RecoveryVO> page, RecoveryVO recovery);
}
src/main/java/org/springblade/modules/recovery/service/impl/RecoveryServiceImpl.java
New file
@@ -0,0 +1,28 @@
package org.springblade.modules.recovery.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.recovery.entity.Recovery;
import org.springblade.modules.recovery.mapper.RecoveryMapper;
import org.springblade.modules.recovery.service.RecoveryService;
import org.springblade.modules.recovery.vo.RecoveryVO;
import org.springframework.stereotype.Service;
/**
 * 采收记录服务实现类
 * @since 2022-05-18
 * @author zhongrj
 */
@Service
public class RecoveryServiceImpl extends ServiceImpl<RecoveryMapper, Recovery> implements RecoveryService {
    /**
     * 自定义分页
     * @param page
     * @param recovery
     * @return
     */
    @Override
    public IPage<RecoveryVO> selectRecoveryPage(IPage<RecoveryVO> page, RecoveryVO recovery) {
        return page.setRecords(baseMapper.selectRecoveryPage(page, recovery));
    }
}
src/main/java/org/springblade/modules/recovery/vo/RecoveryVO.java
New file
@@ -0,0 +1,19 @@
package org.springblade.modules.recovery.vo;
import lombok.Data;
import org.springblade.modules.recovery.entity.Recovery;
/**
 * 采收记录VO
 * @since 2022-05-18
 * @author zhongrj
 */
@Data
public class RecoveryVO extends Recovery {
    private static final long serialVersionUID = 1L;
    /**
     * 地块名称
     */
    private String landName;
}
src/main/java/org/springblade/modules/resource/mapper/RecoveryService.xml
src/main/java/org/springblade/modules/system/mapper/RecoveryService.xml