8 changed files with 417 additions and 0 deletions
@ -0,0 +1,90 @@ |
|||||
|
package org.dromara.business.controller.app; |
||||
|
|
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.dromara.business.domain.BusinessLandConfirm; |
||||
|
import org.dromara.business.domain.bo.BusinessLandConfirmBo; |
||||
|
import org.dromara.business.domain.vo.BusinessLandConfirmVo; |
||||
|
import org.dromara.business.service.app.BusinessLandConfirmService; |
||||
|
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.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 土地确权功能 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/land/confirm/") |
||||
|
@Tag(name = "土地确权相关操作") |
||||
|
public class BusinessLandConfirmController extends BaseController { |
||||
|
|
||||
|
private final BusinessLandConfirmService businessLandConfirmService; |
||||
|
|
||||
|
/** |
||||
|
* 分页查询土地确权信息 |
||||
|
* @param bo |
||||
|
* @param pageQuery |
||||
|
* @return |
||||
|
*/ |
||||
|
@Operation(summary ="分页查询土地确权信息",description = "分页查询土地确权信息") |
||||
|
@SaCheckPermission("business:land:page") |
||||
|
@GetMapping("/page") |
||||
|
public TableDataInfo<BusinessLandConfirmVo> page(BusinessLandConfirmBo bo, PageQuery pageQuery) { |
||||
|
return businessLandConfirmService.queryPageList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增土地确权信息 |
||||
|
*/ |
||||
|
@Operation(summary ="新增土地确权信息",description = "新增土地确权信息") |
||||
|
@SaCheckPermission("business:land:add") |
||||
|
@Log(title = "新增土地确权信息", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping("/add") |
||||
|
public R<BusinessLandConfirm> add(@Validated(AddGroup.class) @RequestBody BusinessLandConfirmBo bo) { |
||||
|
return R.ok(businessLandConfirmService.addLandConfirm(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 编辑土地确权信息 |
||||
|
*/ |
||||
|
@Operation(summary ="编辑土地确权信息",description = "编辑土地确权信息") |
||||
|
@SaCheckPermission("business:land:edit") |
||||
|
@Log(title = "编辑土地确权信息", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping("/edit") |
||||
|
public R<BusinessLandConfirm> edit(@Validated(EditGroup.class) @RequestBody BusinessLandConfirmBo bo) { |
||||
|
return R.ok(businessLandConfirmService.editLandConfirm(bo)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 删除土地确权信息 |
||||
|
* |
||||
|
* @param idList 主键串 |
||||
|
*/ |
||||
|
@Operation(summary ="删除土地确权信息",description = "删除土地确权信息") |
||||
|
@SaCheckPermission("business:land:remove") |
||||
|
@Log(title = "删除土地确权信息", businessType = BusinessType.DELETE) |
||||
|
@PostMapping("/delete") |
||||
|
public R<Void> remove(@RequestBody List<Long> idList) { |
||||
|
return toAjax(businessLandConfirmService.deleteWithValidByIds(idList)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
package org.dromara.business.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("business_land_confirm") |
||||
|
public class BusinessLandConfirm extends BaseEntity { |
||||
|
|
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 租户ID |
||||
|
*/ |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** |
||||
|
* 多边型区域 |
||||
|
*/ |
||||
|
private String polygonRegion; |
||||
|
|
||||
|
/** |
||||
|
* 部门id |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 区域面积 |
||||
|
*/ |
||||
|
private BigDecimal polygonArea; |
||||
|
|
||||
|
/** |
||||
|
* 区域类型 0:点、1是线、2面 |
||||
|
*/ |
||||
|
private Integer areaType; |
||||
|
|
||||
|
/** |
||||
|
* 人工填写面积 |
||||
|
*/ |
||||
|
private BigDecimal area; |
||||
|
|
||||
|
/** |
||||
|
* 所属人员 |
||||
|
*/ |
||||
|
private String belongPerson; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobilePhone; |
||||
|
|
||||
|
/** |
||||
|
* 家庭住址 |
||||
|
*/ |
||||
|
private String address; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package org.dromara.business.domain.bo; |
||||
|
|
||||
|
|
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import jakarta.validation.constraints.NotNull; |
||||
|
import jakarta.validation.constraints.Pattern; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import org.dromara.business.domain.BusinessLandConfirm; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@AutoMapper(target = BusinessLandConfirm.class, reverseConvertGenerate = false) |
||||
|
public class BusinessLandConfirmBo extends BaseEntity { |
||||
|
|
||||
|
@NotNull(message = "主键不能为空", groups = { EditGroup.class }) |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 地图区域 |
||||
|
*/ |
||||
|
@NotNull(message = "地图区域不能为空", groups = {AddGroup.class }) |
||||
|
private String polygonRegion; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 部门id |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 区域面积 |
||||
|
*/ |
||||
|
private BigDecimal polygonArea; |
||||
|
|
||||
|
/** |
||||
|
* 人工填写面积 |
||||
|
*/ |
||||
|
private BigDecimal area; |
||||
|
|
||||
|
/** |
||||
|
* 区域类型 0:点、1是线、2面 |
||||
|
*/ |
||||
|
private Integer areaType; |
||||
|
|
||||
|
/** |
||||
|
* 所属人员 |
||||
|
*/ |
||||
|
private String belongPerson; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确",groups = { EditGroup.class, AddGroup.class }) |
||||
|
private String mobilePhone; |
||||
|
|
||||
|
/** |
||||
|
* 家庭住址 |
||||
|
*/ |
||||
|
private String address; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package org.dromara.business.domain.vo; |
||||
|
|
||||
|
|
||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import org.dromara.business.domain.BusinessLandConfirm; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
@Data |
||||
|
@ExcelIgnoreUnannotated |
||||
|
@AutoMapper(target = BusinessLandConfirm.class) |
||||
|
public class BusinessLandConfirmVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private Long id; |
||||
|
|
||||
|
/** |
||||
|
* 多边型区域 |
||||
|
*/ |
||||
|
private String polygonRegion; |
||||
|
|
||||
|
/** |
||||
|
* 部门id |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
|
||||
|
/** |
||||
|
* 区域面积 |
||||
|
*/ |
||||
|
private BigDecimal polygonArea; |
||||
|
|
||||
|
/** |
||||
|
* 人工填写面积 |
||||
|
*/ |
||||
|
private BigDecimal area; |
||||
|
|
||||
|
/** |
||||
|
* 区域类型 0:点、1是线、2面 |
||||
|
*/ |
||||
|
private Integer areaType; |
||||
|
|
||||
|
/** |
||||
|
* 所属人员 |
||||
|
*/ |
||||
|
private String belongPerson; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobilePhone; |
||||
|
|
||||
|
/** |
||||
|
* 家庭住址 |
||||
|
*/ |
||||
|
private String address; |
||||
|
|
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package org.dromara.business.mapper.app; |
||||
|
|
||||
|
import org.dromara.business.domain.BusinessLandConfirm; |
||||
|
import org.dromara.business.domain.vo.BusinessLandConfirmVo; |
||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
||||
|
|
||||
|
public interface BusinessLandConfirmMapper extends BaseMapperPlus<BusinessLandConfirm, BusinessLandConfirmVo> { |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package org.dromara.business.service.app; |
||||
|
|
||||
|
import org.dromara.business.domain.BusinessLandConfirm; |
||||
|
import org.dromara.business.domain.bo.BusinessLandConfirmBo; |
||||
|
import org.dromara.business.domain.vo.BusinessLandConfirmVo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface BusinessLandConfirmService { |
||||
|
BusinessLandConfirm addLandConfirm(BusinessLandConfirmBo bo); |
||||
|
|
||||
|
BusinessLandConfirm editLandConfirm(BusinessLandConfirmBo bo); |
||||
|
|
||||
|
Boolean deleteWithValidByIds(List<Long> idList); |
||||
|
|
||||
|
TableDataInfo<BusinessLandConfirmVo> queryPageList(BusinessLandConfirmBo bo, PageQuery pageQuery); |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
package org.dromara.business.service.app.impl; |
||||
|
|
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.dromara.business.domain.BusinessLandConfirm; |
||||
|
import org.dromara.business.domain.bo.BusinessLandConfirmBo; |
||||
|
import org.dromara.business.domain.vo.BusinessLandConfirmVo; |
||||
|
import org.dromara.business.mapper.app.BusinessLandConfirmMapper; |
||||
|
import org.dromara.business.service.app.BusinessLandConfirmService; |
||||
|
import org.dromara.common.core.exception.ServiceException; |
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class BusinessLandConfirmServiceImpl extends ServiceImpl<BusinessLandConfirmMapper,BusinessLandConfirm> implements BusinessLandConfirmService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public TableDataInfo<BusinessLandConfirmVo> queryPageList(BusinessLandConfirmBo bo, PageQuery pageQuery) { |
||||
|
LambdaQueryWrapper<BusinessLandConfirm> wrapper = new LambdaQueryWrapper<>(); |
||||
|
Page<BusinessLandConfirmVo> result = this.baseMapper.selectVoPage(pageQuery.build(), wrapper); |
||||
|
return TableDataInfo.build(result); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public BusinessLandConfirm addLandConfirm(BusinessLandConfirmBo bo) { |
||||
|
BusinessLandConfirm businessLandConfirm = MapstructUtils.convert(bo, BusinessLandConfirm.class); |
||||
|
this.baseMapper.insert(businessLandConfirm); |
||||
|
|
||||
|
return businessLandConfirm; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public BusinessLandConfirm editLandConfirm(BusinessLandConfirmBo bo) { |
||||
|
BusinessLandConfirm businessLandConfirm = this.baseMapper.selectById(bo.getId()); |
||||
|
|
||||
|
if (ObjectUtil.isEmpty(businessLandConfirm)) { |
||||
|
throw new ServiceException("对象不存在!"); |
||||
|
} |
||||
|
|
||||
|
BeanUtils.copyProperties(bo, businessLandConfirm); |
||||
|
|
||||
|
this.baseMapper.updateById(businessLandConfirm); |
||||
|
|
||||
|
return businessLandConfirm; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Boolean deleteWithValidByIds(List<Long> idList) { |
||||
|
if (ObjectUtil.isEmpty(idList)) { |
||||
|
throw new ServiceException("参数为空!"); |
||||
|
} |
||||
|
|
||||
|
return this.baseMapper.deleteByIds(idList) > 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.business.mapper.app.BusinessLandConfirmMapper"> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue