27 changed files with 927 additions and 15 deletions
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog; |
||||
|
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
|
||||
import java.util.*; |
||||
import java.io.IOException; |
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; |
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog.vo.*; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO; |
||||
import cn.iocoder.yudao.module.system.service.enterpriseauditlog.EnterpriseAuditLogService; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
@Tag(name = "管理后台 - 企业审核") |
||||
@RestController |
||||
@RequestMapping("/system/enterprise-audit-log") |
||||
@Validated |
||||
public class EnterpriseAuditLogController { |
||||
|
||||
@Resource |
||||
private EnterpriseAuditLogService enterpriseAuditLogService; |
||||
|
||||
@PostMapping("/create") |
||||
@Operation(summary = "创建企业审核") |
||||
@PreAuthorize("@ss.hasPermission('system:enterprise-audit-log:create')") |
||||
public CommonResult<Long> createEnterpriseAuditLog(@Valid @RequestBody EnterpriseAuditLogSaveReqVO createReqVO) { |
||||
return success(enterpriseAuditLogService.createEnterpriseAuditLog(createReqVO)); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
@Operation(summary = "更新企业审核") |
||||
@PreAuthorize("@ss.hasPermission('system:enterprise-audit-log:update')") |
||||
public CommonResult<Boolean> updateEnterpriseAuditLog(@Valid @RequestBody EnterpriseAuditLogSaveReqVO updateReqVO) { |
||||
enterpriseAuditLogService.updateEnterpriseAuditLog(updateReqVO); |
||||
return success(true); |
||||
} |
||||
|
||||
@DeleteMapping("/delete") |
||||
@Operation(summary = "删除企业审核") |
||||
@Parameter(name = "id", description = "编号", required = true) |
||||
@PreAuthorize("@ss.hasPermission('system:enterprise-audit-log:delete')") |
||||
public CommonResult<Boolean> deleteEnterpriseAuditLog(@RequestParam("id") Long id) { |
||||
enterpriseAuditLogService.deleteEnterpriseAuditLog(id); |
||||
return success(true); |
||||
} |
||||
|
||||
@GetMapping("/get") |
||||
@Operation(summary = "获得企业审核") |
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
||||
@PreAuthorize("@ss.hasPermission('system:enterprise-audit-log:query')") |
||||
public CommonResult<EnterpriseAuditLogRespVO> getEnterpriseAuditLog(@RequestParam("id") Long id) { |
||||
EnterpriseAuditLogDO enterpriseAuditLog = enterpriseAuditLogService.getEnterpriseAuditLog(id); |
||||
return success(BeanUtils.toBean(enterpriseAuditLog, EnterpriseAuditLogRespVO.class)); |
||||
} |
||||
|
||||
@GetMapping("/page") |
||||
@Operation(summary = "获得企业审核分页") |
||||
@PreAuthorize("@ss.hasPermission('system:enterprise-audit-log:query')") |
||||
public CommonResult<PageResult<EnterpriseAuditLogRespVO>> getEnterpriseAuditLogPage(@Valid EnterpriseAuditLogPageReqVO pageReqVO) { |
||||
PageResult<EnterpriseAuditLogDO> pageResult = enterpriseAuditLogService.getEnterpriseAuditLogPage(pageReqVO); |
||||
return success(BeanUtils.toBean(pageResult, EnterpriseAuditLogRespVO.class)); |
||||
} |
||||
|
||||
@GetMapping("/export-excel") |
||||
@Operation(summary = "导出企业审核 Excel") |
||||
@PreAuthorize("@ss.hasPermission('system:enterprise-audit-log:export')") |
||||
@ApiAccessLog(operateType = EXPORT) |
||||
public void exportEnterpriseAuditLogExcel(@Valid EnterpriseAuditLogPageReqVO pageReqVO, |
||||
HttpServletResponse response) throws IOException { |
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
||||
List<EnterpriseAuditLogDO> list = enterpriseAuditLogService.getEnterpriseAuditLogPage(pageReqVO).getList(); |
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "企业审核.xls", "数据", EnterpriseAuditLogRespVO.class, |
||||
BeanUtils.toBean(list, EnterpriseAuditLogRespVO.class)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog.vo; |
||||
|
||||
import lombok.*; |
||||
import java.util.*; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import java.time.LocalDateTime; |
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
||||
@Schema(description = "管理后台 - 企业审核分页 Request VO") |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ToString(callSuper = true) |
||||
public class EnterpriseAuditLogPageReqVO extends PageParam { |
||||
|
||||
@Schema(description = "企业信息id", example = "28113") |
||||
private Long enterpriseId; |
||||
|
||||
@Schema(description = "审核状态") |
||||
private Integer audit; |
||||
|
||||
@Schema(description = "审核建议") |
||||
private String content; |
||||
|
||||
@Schema(description = "创建时间") |
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
private LocalDateTime[] createTime; |
||||
|
||||
} |
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog.vo; |
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.*; |
||||
import java.util.*; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import java.time.LocalDateTime; |
||||
import com.alibaba.excel.annotation.*; |
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
||||
|
||||
@Schema(description = "管理后台 - 企业审核 Response VO") |
||||
@Data |
||||
@ExcelIgnoreUnannotated |
||||
public class EnterpriseAuditLogRespVO { |
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11258") |
||||
@ExcelProperty("主键") |
||||
private Long id; |
||||
|
||||
@Schema(description = "企业信息id", example = "28113") |
||||
@ExcelProperty("企业信息id") |
||||
private Long enterpriseId; |
||||
|
||||
@Schema(description = "审核状态") |
||||
@ExcelProperty(value = "审核状态", converter = DictConvert.class) |
||||
@DictFormat("user_audit_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer audit; |
||||
|
||||
@Schema(description = "审核建议") |
||||
@ExcelProperty("审核建议") |
||||
private String content; |
||||
|
||||
@Schema(description = "创建时间") |
||||
@ExcelProperty("创建时间") |
||||
private LocalDateTime createTime; |
||||
|
||||
} |
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog.vo; |
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.*; |
||||
import java.util.*; |
||||
|
||||
@Schema(description = "管理后台 - 企业审核新增/修改 Request VO") |
||||
@Data |
||||
public class EnterpriseAuditLogSaveReqVO { |
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11258") |
||||
private Long id; |
||||
|
||||
@Schema(description = "企业信息id", example = "28113") |
||||
private Long enterpriseId; |
||||
|
||||
@Schema(description = "审核状态") |
||||
private Integer audit; |
||||
|
||||
@Schema(description = "审核建议") |
||||
private String content; |
||||
|
||||
} |
@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.taglibrary; |
||||
|
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import java.util.*; |
||||
import java.io.IOException; |
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; |
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo.*; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO; |
||||
import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
@Tag(name = "管理后台 - 企业标签") |
||||
@RestController |
||||
@RequestMapping("/system/tag-library") |
||||
@Validated |
||||
public class TagLibraryController { |
||||
|
||||
@Resource |
||||
private TagLibraryService tagLibraryService; |
||||
|
||||
@PostMapping("/create") |
||||
@Operation(summary = "创建企业标签") |
||||
@PreAuthorize("@ss.hasPermission('system:tag-library:create')") |
||||
public CommonResult<Integer> createTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO createReqVO) { |
||||
return success(tagLibraryService.createTagLibrary(createReqVO)); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
@Operation(summary = "更新企业标签") |
||||
@PreAuthorize("@ss.hasPermission('system:tag-library:update')") |
||||
public CommonResult<Boolean> updateTagLibrary(@Valid @RequestBody TagLibrarySaveReqVO updateReqVO) { |
||||
tagLibraryService.updateTagLibrary(updateReqVO); |
||||
return success(true); |
||||
} |
||||
|
||||
@DeleteMapping("/delete") |
||||
@Operation(summary = "删除企业标签") |
||||
@Parameter(name = "id", description = "编号", required = true) |
||||
@PreAuthorize("@ss.hasPermission('system:tag-library:delete')") |
||||
public CommonResult<Boolean> deleteTagLibrary(@RequestParam("id") Integer id) { |
||||
tagLibraryService.deleteTagLibrary(id); |
||||
return success(true); |
||||
} |
||||
|
||||
@GetMapping("/get") |
||||
@Operation(summary = "获得企业标签") |
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024") |
||||
@PreAuthorize("@ss.hasPermission('system:tag-library:query')") |
||||
public CommonResult<TagLibraryRespVO> getTagLibrary(@RequestParam("id") Integer id) { |
||||
TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(id); |
||||
return success(BeanUtils.toBean(tagLibrary, TagLibraryRespVO.class)); |
||||
} |
||||
|
||||
@GetMapping("/page") |
||||
@Operation(summary = "获得企业标签分页") |
||||
@PreAuthorize("@ss.hasPermission('system:tag-library:query')") |
||||
public CommonResult<List<TagLibraryRespVO>> getTagLibraryPage(TagLibraryPageReqVO pageReqVO) { |
||||
List<TagLibraryDO> pageResult = tagLibraryService.getTagLibraryPage(pageReqVO); |
||||
return success(BeanUtils.toBean(pageResult, TagLibraryRespVO.class)); |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo; |
||||
|
||||
import lombok.*; |
||||
import java.util.*; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import java.time.LocalDateTime; |
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
||||
@Schema(description = "管理后台 - 企业标签分页 Request VO") |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ToString(callSuper = true) |
||||
public class TagLibraryPageReqVO extends PageParam { |
||||
|
||||
@Schema(description = "标签的名称", example = "王五") |
||||
private String tagName; |
||||
|
||||
@Schema(description = "父标签的ID", example = "30648") |
||||
private Integer parentId; |
||||
|
||||
@Schema(description = "标签层级(一级、二级、三级)") |
||||
private Integer tagLevel; |
||||
|
||||
@Schema(description = "1、企业标签2、执法标签", example = "2") |
||||
private Integer tagType; |
||||
|
||||
@Schema(description = "创建时间") |
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
private LocalDateTime[] createTime; |
||||
|
||||
} |
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo; |
||||
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.*; |
||||
import java.util.*; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import java.time.LocalDateTime; |
||||
import com.alibaba.excel.annotation.*; |
||||
|
||||
@Schema(description = "管理后台 - 企业标签 Response VO") |
||||
@Data |
||||
@ExcelIgnoreUnannotated |
||||
public class TagLibraryRespVO { |
||||
|
||||
@Schema(description = "签的唯一标识,自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4578") |
||||
@ExcelProperty("签的唯一标识,自增主键") |
||||
private Integer id; |
||||
|
||||
@Schema(description = "标签的名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") |
||||
@ExcelProperty("标签的名称") |
||||
private String tagName; |
||||
|
||||
@Schema(description = "父标签的ID", example = "30648") |
||||
@ExcelProperty("父标签的ID") |
||||
private Integer parentId; |
||||
|
||||
@Schema(description = "标签层级(一级、二级、三级)", requiredMode = Schema.RequiredMode.REQUIRED) |
||||
@ExcelProperty("标签层级(一级、二级、三级)") |
||||
private Integer tagLevel; |
||||
|
||||
@Schema(description = "1、企业标签2、执法标签", example = "2") |
||||
@ExcelProperty("1、企业标签2、执法标签") |
||||
private Integer tagType; |
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
||||
@ExcelProperty("创建时间") |
||||
private LocalDateTime createTime; |
||||
|
||||
private List<TagLibraryDO> children = new ArrayList<>(); // 子标签列表
|
||||
|
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo; |
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.*; |
||||
|
||||
import javax.validation.constraints.NotEmpty; |
||||
import javax.validation.constraints.NotNull; |
||||
import java.util.*; |
||||
|
||||
@Schema(description = "管理后台 - 企业标签新增/修改 Request VO") |
||||
@Data |
||||
public class TagLibrarySaveReqVO { |
||||
|
||||
@Schema(description = "签的唯一标识,自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4578") |
||||
private Integer id; |
||||
|
||||
@Schema(description = "标签的名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") |
||||
@NotEmpty(message = "标签的名称不能为空") |
||||
private String tagName; |
||||
|
||||
@Schema(description = "父标签的ID", example = "30648") |
||||
private Integer parentId; |
||||
|
||||
@Schema(description = "标签层级(一级、二级、三级)", requiredMode = Schema.RequiredMode.REQUIRED) |
||||
@NotNull(message = "标签层级(一级、二级、三级)不能为空") |
||||
private Integer tagLevel; |
||||
|
||||
@Schema(description = "1、企业标签2、执法标签", example = "2") |
||||
private Integer tagType; |
||||
|
||||
} |
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog; |
||||
|
||||
import com.sun.xml.bind.v2.TODO; |
||||
import lombok.*; |
||||
import java.util.*; |
||||
import java.time.LocalDateTime; |
||||
import java.time.LocalDateTime; |
||||
import com.baomidou.mybatisplus.annotation.*; |
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
||||
|
||||
/** |
||||
* 企业审核 DO |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
@TableName("enterprise_audit_log") |
||||
@KeySequence("enterprise_audit_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ToString(callSuper = true) |
||||
@Builder |
||||
@NoArgsConstructor |
||||
@AllArgsConstructor |
||||
public class EnterpriseAuditLogDO extends BaseDO { |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@TableId |
||||
private Long id; |
||||
/** |
||||
* 企业信息id |
||||
*/ |
||||
private Long enterpriseId; |
||||
/** |
||||
* 审核状态 |
||||
* |
||||
* 枚举 {@link TODO user_audit_type 对应的类} |
||||
*/ |
||||
private Integer audit; |
||||
/** |
||||
* 审核建议 |
||||
*/ |
||||
private String content; |
||||
|
||||
} |
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.taglibrary; |
||||
|
||||
import lombok.*; |
||||
import java.util.*; |
||||
import java.time.LocalDateTime; |
||||
import java.time.LocalDateTime; |
||||
import com.baomidou.mybatisplus.annotation.*; |
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
||||
|
||||
/** |
||||
* 企业标签 DO |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
@TableName("tag_library") |
||||
@KeySequence("tag_library_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ToString(callSuper = true) |
||||
@Builder |
||||
@NoArgsConstructor |
||||
@AllArgsConstructor |
||||
public class TagLibraryDO extends BaseDO { |
||||
|
||||
/** |
||||
* 签的唯一标识,自增主键 |
||||
*/ |
||||
@TableId |
||||
private Integer id; |
||||
/** |
||||
* 标签的名称 |
||||
*/ |
||||
private String tagName; |
||||
/** |
||||
* 父标签的ID |
||||
*/ |
||||
private Integer parentId; |
||||
/** |
||||
* 标签层级(一级、二级、三级) |
||||
*/ |
||||
private Integer tagLevel; |
||||
/** |
||||
* 1、企业标签2、执法标签 |
||||
*/ |
||||
private Integer tagType; |
||||
|
||||
@TableField(exist = false) |
||||
private List<TagLibraryDO> children = new ArrayList<>(); // 子标签列表
|
||||
|
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.enterpriseauditlog; |
||||
|
||||
import java.util.*; |
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog.vo.*; |
||||
|
||||
/** |
||||
* 企业审核 Mapper |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
@Mapper |
||||
public interface EnterpriseAuditLogMapper extends BaseMapperX<EnterpriseAuditLogDO> { |
||||
|
||||
default PageResult<EnterpriseAuditLogDO> selectPage(EnterpriseAuditLogPageReqVO reqVO) { |
||||
return selectPage(reqVO, new LambdaQueryWrapperX<EnterpriseAuditLogDO>() |
||||
.eqIfPresent(EnterpriseAuditLogDO::getEnterpriseId, reqVO.getEnterpriseId()) |
||||
.eqIfPresent(EnterpriseAuditLogDO::getAudit, reqVO.getAudit()) |
||||
.eqIfPresent(EnterpriseAuditLogDO::getContent, reqVO.getContent()) |
||||
.betweenIfPresent(EnterpriseAuditLogDO::getCreateTime, reqVO.getCreateTime()) |
||||
.orderByDesc(EnterpriseAuditLogDO::getId)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.taglibrary; |
||||
|
||||
import java.util.*; |
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo.*; |
||||
|
||||
/** |
||||
* 企业标签 Mapper |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
@Mapper |
||||
public interface TagLibraryMapper extends BaseMapperX<TagLibraryDO> { |
||||
|
||||
default PageResult<TagLibraryDO> selectPage(TagLibraryPageReqVO reqVO) { |
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TagLibraryDO>() |
||||
.likeIfPresent(TagLibraryDO::getTagName, reqVO.getTagName()) |
||||
.eqIfPresent(TagLibraryDO::getParentId, reqVO.getParentId()) |
||||
.eqIfPresent(TagLibraryDO::getTagLevel, reqVO.getTagLevel()) |
||||
.eqIfPresent(TagLibraryDO::getTagType, reqVO.getTagType()) |
||||
.betweenIfPresent(TagLibraryDO::getCreateTime, reqVO.getCreateTime()) |
||||
.orderByDesc(TagLibraryDO::getId)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.system.service.enterpriseauditlog; |
||||
|
||||
import java.util.*; |
||||
import cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog.vo.*; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
/** |
||||
* 企业审核 Service 接口 |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
public interface EnterpriseAuditLogService { |
||||
|
||||
/** |
||||
* 创建企业审核 |
||||
* |
||||
* @param createReqVO 创建信息 |
||||
* @return 编号 |
||||
*/ |
||||
Long createEnterpriseAuditLog(@Valid EnterpriseAuditLogSaveReqVO createReqVO); |
||||
|
||||
/** |
||||
* 更新企业审核 |
||||
* |
||||
* @param updateReqVO 更新信息 |
||||
*/ |
||||
void updateEnterpriseAuditLog(@Valid EnterpriseAuditLogSaveReqVO updateReqVO); |
||||
|
||||
/** |
||||
* 删除企业审核 |
||||
* |
||||
* @param id 编号 |
||||
*/ |
||||
void deleteEnterpriseAuditLog(Long id); |
||||
|
||||
/** |
||||
* 获得企业审核 |
||||
* |
||||
* @param id 编号 |
||||
* @return 企业审核 |
||||
*/ |
||||
EnterpriseAuditLogDO getEnterpriseAuditLog(Long id); |
||||
|
||||
/** |
||||
* 获得企业审核分页 |
||||
* |
||||
* @param pageReqVO 分页查询 |
||||
* @return 企业审核分页 |
||||
*/ |
||||
PageResult<EnterpriseAuditLogDO> getEnterpriseAuditLogPage(EnterpriseAuditLogPageReqVO pageReqVO); |
||||
|
||||
} |
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.system.service.enterpriseauditlog; |
||||
|
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.*; |
||||
import cn.iocoder.yudao.module.system.controller.admin.enterpriseauditlog.vo.*; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseauditlog.EnterpriseAuditLogMapper; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; |
||||
|
||||
/** |
||||
* 企业审核 Service 实现类 |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
@Service |
||||
@Validated |
||||
public class EnterpriseAuditLogServiceImpl implements EnterpriseAuditLogService { |
||||
|
||||
@Resource |
||||
private EnterpriseAuditLogMapper enterpriseAuditLogMapper; |
||||
|
||||
@Override |
||||
public Long createEnterpriseAuditLog(EnterpriseAuditLogSaveReqVO createReqVO) { |
||||
// 插入
|
||||
EnterpriseAuditLogDO enterpriseAuditLog = BeanUtils.toBean(createReqVO, EnterpriseAuditLogDO.class); |
||||
enterpriseAuditLogMapper.insert(enterpriseAuditLog); |
||||
// 返回
|
||||
return enterpriseAuditLog.getId(); |
||||
} |
||||
|
||||
@Override |
||||
public void updateEnterpriseAuditLog(EnterpriseAuditLogSaveReqVO updateReqVO) { |
||||
// 校验存在
|
||||
validateEnterpriseAuditLogExists(updateReqVO.getId()); |
||||
// 更新
|
||||
EnterpriseAuditLogDO updateObj = BeanUtils.toBean(updateReqVO, EnterpriseAuditLogDO.class); |
||||
enterpriseAuditLogMapper.updateById(updateObj); |
||||
} |
||||
|
||||
@Override |
||||
public void deleteEnterpriseAuditLog(Long id) { |
||||
// 校验存在
|
||||
validateEnterpriseAuditLogExists(id); |
||||
// 删除
|
||||
enterpriseAuditLogMapper.deleteById(id); |
||||
} |
||||
|
||||
private void validateEnterpriseAuditLogExists(Long id) { |
||||
if (enterpriseAuditLogMapper.selectById(id) == null) { |
||||
throw exception(USER_COUNT_MAX); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public EnterpriseAuditLogDO getEnterpriseAuditLog(Long id) { |
||||
return enterpriseAuditLogMapper.selectById(id); |
||||
} |
||||
|
||||
@Override |
||||
public PageResult<EnterpriseAuditLogDO> getEnterpriseAuditLogPage(EnterpriseAuditLogPageReqVO pageReqVO) { |
||||
return enterpriseAuditLogMapper.selectPage(pageReqVO); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.system.service.taglibrary; |
||||
|
||||
import java.util.*; |
||||
import cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo.*; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
/** |
||||
* 企业标签 Service 接口 |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
public interface TagLibraryService { |
||||
|
||||
/** |
||||
* 创建企业标签 |
||||
* |
||||
* @param createReqVO 创建信息 |
||||
* @return 编号 |
||||
*/ |
||||
Integer createTagLibrary(@Valid TagLibrarySaveReqVO createReqVO); |
||||
|
||||
/** |
||||
* 更新企业标签 |
||||
* |
||||
* @param updateReqVO 更新信息 |
||||
*/ |
||||
void updateTagLibrary(@Valid TagLibrarySaveReqVO updateReqVO); |
||||
|
||||
/** |
||||
* 删除企业标签 |
||||
* |
||||
* @param id 编号 |
||||
*/ |
||||
void deleteTagLibrary(Integer id); |
||||
|
||||
/** |
||||
* 获得企业标签 |
||||
* |
||||
* @param id 编号 |
||||
* @return 企业标签 |
||||
*/ |
||||
TagLibraryDO getTagLibrary(Integer id); |
||||
|
||||
/** |
||||
* 获得企业标签分页 |
||||
* |
||||
* @param pageReqVO 分页查询 |
||||
* @return 企业标签分页 |
||||
*/ |
||||
List<TagLibraryDO> getTagLibraryPage(TagLibraryPageReqVO pageReqVO); |
||||
|
||||
} |
@ -0,0 +1,90 @@
|
||||
package cn.iocoder.yudao.module.system.service.taglibrary; |
||||
|
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import cn.iocoder.yudao.module.system.controller.admin.taglibrary.vo.*; |
||||
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO; |
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult; |
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.taglibrary.TagLibraryMapper; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; |
||||
|
||||
/** |
||||
* 企业标签 Service 实现类 |
||||
* |
||||
* @author 芋道源码 |
||||
*/ |
||||
@Service |
||||
@Validated |
||||
public class TagLibraryServiceImpl implements TagLibraryService { |
||||
|
||||
@Resource |
||||
private TagLibraryMapper tagLibraryMapper; |
||||
|
||||
@Override |
||||
public Integer createTagLibrary(TagLibrarySaveReqVO createReqVO) { |
||||
// 插入
|
||||
TagLibraryDO tagLibrary = BeanUtils.toBean(createReqVO, TagLibraryDO.class); |
||||
tagLibraryMapper.insert(tagLibrary); |
||||
// 返回
|
||||
return tagLibrary.getId(); |
||||
} |
||||
|
||||
@Override |
||||
public void updateTagLibrary(TagLibrarySaveReqVO updateReqVO) { |
||||
// 校验存在
|
||||
validateTagLibraryExists(updateReqVO.getId()); |
||||
// 更新
|
||||
TagLibraryDO updateObj = BeanUtils.toBean(updateReqVO, TagLibraryDO.class); |
||||
tagLibraryMapper.updateById(updateObj); |
||||
} |
||||
|
||||
@Override |
||||
public void deleteTagLibrary(Integer id) { |
||||
// 校验存在
|
||||
validateTagLibraryExists(id); |
||||
// 删除
|
||||
tagLibraryMapper.deleteById(id); |
||||
} |
||||
|
||||
private void validateTagLibraryExists(Integer id) { |
||||
if (tagLibraryMapper.selectById(id) == null) { |
||||
throw exception(USER_MOBILE_EXISTS); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public TagLibraryDO getTagLibrary(Integer id) { |
||||
return tagLibraryMapper.selectById(id); |
||||
} |
||||
|
||||
@Override |
||||
public List<TagLibraryDO> getTagLibraryPage(TagLibraryPageReqVO pageReqVO) { |
||||
pageReqVO.setPageSize(-1); |
||||
final List<TagLibraryDO> list = tagLibraryMapper.selectPage(pageReqVO).getList(); |
||||
return buildTree(list, 0); |
||||
} |
||||
|
||||
// 递归构建树
|
||||
private List<TagLibraryDO> buildTree(List<TagLibraryDO> tags, Integer parentId) { |
||||
List<TagLibraryDO> tree = new ArrayList<>(); |
||||
for (TagLibraryDO tag : tags) { |
||||
if (tag.getParentId().equals(parentId)) { |
||||
// 递归查找子节点
|
||||
tag.setChildren(buildTree(tags, tag.getId())); |
||||
tree.add(tag); |
||||
} |
||||
} |
||||
return tree; |
||||
} |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue