18 changed files with 927 additions and 5 deletions
@ -0,0 +1,105 @@ |
|||
package org.dromara.platform.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.platform.domain.vo.ContractTypeVo; |
|||
import org.dromara.platform.domain.bo.ContractTypeBo; |
|||
import org.dromara.platform.service.IContractTypeService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 合同类别-类别 |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/platform/contractType") |
|||
public class ContractTypeController extends BaseController { |
|||
|
|||
private final IContractTypeService contractTypeService; |
|||
|
|||
/** |
|||
* 查询合同类别-类别列表 |
|||
*/ |
|||
@SaCheckPermission("platform:contractType:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ContractTypeVo> list(ContractTypeBo bo, PageQuery pageQuery) { |
|||
return contractTypeService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出合同类别-类别列表 |
|||
*/ |
|||
@SaCheckPermission("platform:contractType:export") |
|||
@Log(title = "合同类别-类别", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ContractTypeBo bo, HttpServletResponse response) { |
|||
List<ContractTypeVo> list = contractTypeService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "合同类别-类别", ContractTypeVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取合同类别-类别详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("platform:contractType:query") |
|||
@GetMapping("/{id}") |
|||
public R<ContractTypeVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(contractTypeService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增合同类别-类别 |
|||
*/ |
|||
@SaCheckPermission("platform:contractType:add") |
|||
@Log(title = "合同类别-类别", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ContractTypeBo bo) { |
|||
return toAjax(contractTypeService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改合同类别-类别 |
|||
*/ |
|||
@SaCheckPermission("platform:contractType:edit") |
|||
@Log(title = "合同类别-类别", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ContractTypeBo bo) { |
|||
return toAjax(contractTypeService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除合同类别-类别 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("platform:contractType:remove") |
|||
@Log(title = "合同类别-类别", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(contractTypeService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
package org.dromara.platform.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.platform.domain.vo.DocumentTypeVo; |
|||
import org.dromara.platform.domain.bo.DocumentTypeBo; |
|||
import org.dromara.platform.service.IDocumentTypeService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 文件类别-类别 |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/platform/documentType") |
|||
public class DocumentTypeController extends BaseController { |
|||
|
|||
private final IDocumentTypeService documentTypeService; |
|||
|
|||
/** |
|||
* 查询文件类别-类别列表 |
|||
*/ |
|||
@SaCheckPermission("platform:documentType:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<DocumentTypeVo> list(DocumentTypeBo bo, PageQuery pageQuery) { |
|||
return documentTypeService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出文件类别-类别列表 |
|||
*/ |
|||
@SaCheckPermission("platform:documentType:export") |
|||
@Log(title = "文件类别-类别", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(DocumentTypeBo bo, HttpServletResponse response) { |
|||
List<DocumentTypeVo> list = documentTypeService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "文件类别-类别", DocumentTypeVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取文件类别-类别详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("platform:documentType:query") |
|||
@GetMapping("/{id}") |
|||
public R<DocumentTypeVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(documentTypeService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增文件类别-类别 |
|||
*/ |
|||
@SaCheckPermission("platform:documentType:add") |
|||
@Log(title = "文件类别-类别", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DocumentTypeBo bo) { |
|||
return toAjax(documentTypeService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改文件类别-类别 |
|||
*/ |
|||
@SaCheckPermission("platform:documentType:edit") |
|||
@Log(title = "文件类别-类别", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DocumentTypeBo bo) { |
|||
return toAjax(documentTypeService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除文件类别-类别 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("platform:documentType:remove") |
|||
@Log(title = "文件类别-类别", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(documentTypeService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
package org.dromara.platform.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 合同类别-类别对象 contract_type |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("contract_type") |
|||
public class ContractType extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识符 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 合同类别名称 |
|||
*/ |
|||
private String typeName; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
*/ |
|||
private Long status; |
|||
|
|||
/** |
|||
* 删除标志(0代表存在 2代表删除) |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package org.dromara.platform.domain; |
|||
|
|||
import org.dromara.common.tenant.core.TenantEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 文件类别-类别对象 document_type |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("document_type") |
|||
public class DocumentType extends TenantEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识符 |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 文件类别名称 |
|||
*/ |
|||
private String typeName; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
*/ |
|||
private Long status; |
|||
|
|||
/** |
|||
* 删除标志(0代表存在 2代表删除) |
|||
*/ |
|||
@TableLogic |
|||
private String delFlag; |
|||
|
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
package org.dromara.platform.domain.bo; |
|||
|
|||
import org.dromara.platform.domain.ContractType; |
|||
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.*; |
|||
|
|||
/** |
|||
* 合同类别-类别业务对象 contract_type |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ContractType.class, reverseConvertGenerate = false) |
|||
public class ContractTypeBo extends BaseEntity { |
|||
|
|||
/** |
|||
* 唯一标识符 |
|||
*/ |
|||
@NotBlank(message = "唯一标识符不能为空", groups = { EditGroup.class }) |
|||
private String id; |
|||
|
|||
/** |
|||
* 合同类别名称 |
|||
*/ |
|||
@NotBlank(message = "合同类别名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String typeName; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
*/ |
|||
@NotNull(message = "当前状态不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long status; |
|||
|
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
package org.dromara.platform.domain.bo; |
|||
|
|||
import org.dromara.platform.domain.DocumentType; |
|||
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.*; |
|||
|
|||
/** |
|||
* 文件类别-类别业务对象 document_type |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = DocumentType.class, reverseConvertGenerate = false) |
|||
public class DocumentTypeBo extends BaseEntity { |
|||
|
|||
/** |
|||
* 唯一标识符 |
|||
*/ |
|||
@NotBlank(message = "唯一标识符不能为空", groups = { EditGroup.class }) |
|||
private String id; |
|||
|
|||
/** |
|||
* 文件类别名称 |
|||
*/ |
|||
@NotBlank(message = "文件类别名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String typeName; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
*/ |
|||
@NotNull(message = "当前状态不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long status; |
|||
|
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package org.dromara.platform.domain.vo; |
|||
|
|||
import org.dromara.platform.domain.ContractType; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.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; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 合同类别-类别视图对象 contract_type |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ContractType.class) |
|||
public class ContractTypeVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识符 |
|||
*/ |
|||
@ExcelProperty(value = "唯一标识符") |
|||
private String id; |
|||
|
|||
/** |
|||
* 合同类别名称 |
|||
*/ |
|||
@ExcelProperty(value = "合同类别名称") |
|||
private String typeName; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
*/ |
|||
// @ExcelProperty(value = "当前状态")
|
|||
// private Long status;
|
|||
|
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package org.dromara.platform.domain.vo; |
|||
|
|||
import org.dromara.platform.domain.DocumentType; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.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; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 文件类别-类别视图对象 document_type |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = DocumentType.class) |
|||
public class DocumentTypeVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识符 |
|||
*/ |
|||
@ExcelProperty(value = "唯一标识符") |
|||
private String id; |
|||
|
|||
/** |
|||
* 文件类别名称 |
|||
*/ |
|||
@ExcelProperty(value = "文件类别名称") |
|||
private String typeName; |
|||
|
|||
/** |
|||
* 当前状态 |
|||
*/ |
|||
// @ExcelProperty(value = "当前状态")
|
|||
// private Long status;
|
|||
|
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package org.dromara.platform.mapper; |
|||
|
|||
import org.dromara.platform.domain.ContractType; |
|||
import org.dromara.platform.domain.vo.ContractTypeVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 合同类别-类别Mapper接口 |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
public interface ContractTypeMapper extends BaseMapperPlus<ContractType, ContractTypeVo> { |
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package org.dromara.platform.mapper; |
|||
|
|||
import org.dromara.platform.domain.DocumentType; |
|||
import org.dromara.platform.domain.vo.DocumentTypeVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 文件类别-类别Mapper接口 |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
public interface DocumentTypeMapper extends BaseMapperPlus<DocumentType, DocumentTypeVo> { |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package org.dromara.platform.service; |
|||
|
|||
import org.dromara.platform.domain.vo.ContractTypeVo; |
|||
import org.dromara.platform.domain.bo.ContractTypeBo; |
|||
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 gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
public interface IContractTypeService { |
|||
|
|||
/** |
|||
* 查询合同类别-类别 |
|||
* |
|||
* @param id 主键 |
|||
* @return 合同类别-类别 |
|||
*/ |
|||
ContractTypeVo queryById(String id); |
|||
|
|||
/** |
|||
* 分页查询合同类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 合同类别-类别分页列表 |
|||
*/ |
|||
TableDataInfo<ContractTypeVo> queryPageList(ContractTypeBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的合同类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 合同类别-类别列表 |
|||
*/ |
|||
List<ContractTypeVo> queryList(ContractTypeBo bo); |
|||
|
|||
/** |
|||
* 新增合同类别-类别 |
|||
* |
|||
* @param bo 合同类别-类别 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ContractTypeBo bo); |
|||
|
|||
/** |
|||
* 修改合同类别-类别 |
|||
* |
|||
* @param bo 合同类别-类别 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ContractTypeBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除合同类别-类别信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid); |
|||
} |
@ -0,0 +1,68 @@ |
|||
package org.dromara.platform.service; |
|||
|
|||
import org.dromara.platform.domain.vo.DocumentTypeVo; |
|||
import org.dromara.platform.domain.bo.DocumentTypeBo; |
|||
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 gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
public interface IDocumentTypeService { |
|||
|
|||
/** |
|||
* 查询文件类别-类别 |
|||
* |
|||
* @param id 主键 |
|||
* @return 文件类别-类别 |
|||
*/ |
|||
DocumentTypeVo queryById(String id); |
|||
|
|||
/** |
|||
* 分页查询文件类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 文件类别-类别分页列表 |
|||
*/ |
|||
TableDataInfo<DocumentTypeVo> queryPageList(DocumentTypeBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的文件类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 文件类别-类别列表 |
|||
*/ |
|||
List<DocumentTypeVo> queryList(DocumentTypeBo bo); |
|||
|
|||
/** |
|||
* 新增文件类别-类别 |
|||
* |
|||
* @param bo 文件类别-类别 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(DocumentTypeBo bo); |
|||
|
|||
/** |
|||
* 修改文件类别-类别 |
|||
* |
|||
* @param bo 文件类别-类别 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(DocumentTypeBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除文件类别-类别信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid); |
|||
} |
@ -0,0 +1,130 @@ |
|||
package org.dromara.platform.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 org.springframework.stereotype.Service; |
|||
import org.dromara.platform.domain.bo.ContractTypeBo; |
|||
import org.dromara.platform.domain.vo.ContractTypeVo; |
|||
import org.dromara.platform.domain.ContractType; |
|||
import org.dromara.platform.mapper.ContractTypeMapper; |
|||
import org.dromara.platform.service.IContractTypeService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 合同类别-类别Service业务层处理 |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ContractTypeServiceImpl implements IContractTypeService { |
|||
|
|||
private final ContractTypeMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询合同类别-类别 |
|||
* |
|||
* @param id 主键 |
|||
* @return 合同类别-类别 |
|||
*/ |
|||
@Override |
|||
public ContractTypeVo queryById(String id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询合同类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 合同类别-类别分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ContractTypeVo> queryPageList(ContractTypeBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ContractType> lqw = buildQueryWrapper(bo); |
|||
Page<ContractTypeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的合同类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 合同类别-类别列表 |
|||
*/ |
|||
@Override |
|||
public List<ContractTypeVo> queryList(ContractTypeBo bo) { |
|||
LambdaQueryWrapper<ContractType> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ContractType> buildQueryWrapper(ContractTypeBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ContractType> lqw = Wrappers.lambdaQuery(); |
|||
lqw.like(StringUtils.isNotBlank(bo.getTypeName()), ContractType::getTypeName, bo.getTypeName()); |
|||
lqw.eq(bo.getStatus() != null, ContractType::getStatus, bo.getStatus()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增合同类别-类别 |
|||
* |
|||
* @param bo 合同类别-类别 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ContractTypeBo bo) { |
|||
ContractType add = MapstructUtils.convert(bo, ContractType.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改合同类别-类别 |
|||
* |
|||
* @param bo 合同类别-类别 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ContractTypeBo bo) { |
|||
ContractType update = MapstructUtils.convert(bo, ContractType.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ContractType entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除合同类别-类别信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
@ -0,0 +1,130 @@ |
|||
package org.dromara.platform.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 org.springframework.stereotype.Service; |
|||
import org.dromara.platform.domain.bo.DocumentTypeBo; |
|||
import org.dromara.platform.domain.vo.DocumentTypeVo; |
|||
import org.dromara.platform.domain.DocumentType; |
|||
import org.dromara.platform.mapper.DocumentTypeMapper; |
|||
import org.dromara.platform.service.IDocumentTypeService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 文件类别-类别Service业务层处理 |
|||
* |
|||
* @author gejunhao |
|||
* @date 2025-04-08 |
|||
*/ |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class DocumentTypeServiceImpl implements IDocumentTypeService { |
|||
|
|||
private final DocumentTypeMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询文件类别-类别 |
|||
* |
|||
* @param id 主键 |
|||
* @return 文件类别-类别 |
|||
*/ |
|||
@Override |
|||
public DocumentTypeVo queryById(String id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询文件类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 文件类别-类别分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<DocumentTypeVo> queryPageList(DocumentTypeBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<DocumentType> lqw = buildQueryWrapper(bo); |
|||
Page<DocumentTypeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的文件类别-类别列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 文件类别-类别列表 |
|||
*/ |
|||
@Override |
|||
public List<DocumentTypeVo> queryList(DocumentTypeBo bo) { |
|||
LambdaQueryWrapper<DocumentType> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<DocumentType> buildQueryWrapper(DocumentTypeBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<DocumentType> lqw = Wrappers.lambdaQuery(); |
|||
lqw.like(StringUtils.isNotBlank(bo.getTypeName()), DocumentType::getTypeName, bo.getTypeName()); |
|||
lqw.eq(bo.getStatus() != null, DocumentType::getStatus, bo.getStatus()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增文件类别-类别 |
|||
* |
|||
* @param bo 文件类别-类别 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(DocumentTypeBo bo) { |
|||
DocumentType add = MapstructUtils.convert(bo, DocumentType.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改文件类别-类别 |
|||
* |
|||
* @param bo 文件类别-类别 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(DocumentTypeBo bo) { |
|||
DocumentType update = MapstructUtils.convert(bo, DocumentType.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(DocumentType entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除文件类别-类别信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
Loading…
Reference in new issue