【数据资产】
开发主体附件实体
Showing
10 changed files
with
846 additions
and
0 deletions
| 1 | package com.csbr.qingcloud.portal.controller; | ||
| 2 | |||
| 3 | import com.csbr.cloud.common.response.CommonRes; | ||
| 4 | import csbr.cloud.entity.annotation.SystemLog; | ||
| 5 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 6 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentQueryVO; | ||
| 7 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRQVO; | ||
| 8 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO; | ||
| 9 | import com.csbr.qingcloud.portal.service.EnterpriseAttachmentService; | ||
| 10 | import io.swagger.v3.oas.annotations.Operation; | ||
| 11 | import io.swagger.v3.oas.annotations.Parameter; | ||
| 12 | import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 13 | import jakarta.annotation.Resource; | ||
| 14 | import jakarta.validation.Valid; | ||
| 15 | import org.springframework.web.bind.annotation.*; | ||
| 16 | |||
| 17 | import java.util.List; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * @program: | ||
| 21 | * @description: 开发主体附件信息-控制器 | ||
| 22 | * @author: makejava | ||
| 23 | * @create: 2025-09-05 13:50 | ||
| 24 | **/ | ||
| 25 | @RestController | ||
| 26 | @RequestMapping("/enterprise-attachment") | ||
| 27 | @Tag(name = "开发主体附件信息-控制器") | ||
| 28 | public class EnterpriseAttachmentController { | ||
| 29 | |||
| 30 | @Resource | ||
| 31 | private EnterpriseAttachmentService enterpriseAttachmentService; | ||
| 32 | |||
| 33 | //region 基本操作 | ||
| 34 | |||
| 35 | @PostMapping("/save") | ||
| 36 | @SystemLog(value = "开发主体附件信息-新增") | ||
| 37 | @Operation(summary = "开发主体附件信息-新增") | ||
| 38 | public CommonRes<Boolean> saveEnterpriseAttachment(@RequestBody @Valid EnterpriseAttachmentRQVO vo) { | ||
| 39 | enterpriseAttachmentService.saveEnterpriseAttachment(vo); | ||
| 40 | return CommonRes.success(true); | ||
| 41 | } | ||
| 42 | |||
| 43 | @PutMapping("/update") | ||
| 44 | @SystemLog(value = "开发主体附件信息-修改") | ||
| 45 | @Operation(summary = "开发主体附件信息-修改") | ||
| 46 | public CommonRes<Boolean> updateEnterpriseAttachment(@RequestBody @Valid EnterpriseAttachmentRQVO vo) { | ||
| 47 | enterpriseAttachmentService.updateEnterpriseAttachment(vo); | ||
| 48 | return CommonRes.success(true); | ||
| 49 | } | ||
| 50 | |||
| 51 | @DeleteMapping("/delete") | ||
| 52 | @SystemLog(value = "开发主体附件信息-批量删除") | ||
| 53 | @Operation(summary = "开发主体附件信息-批量删除") | ||
| 54 | public CommonRes<Boolean> removeByGuids(@RequestBody List<String> guids) { | ||
| 55 | enterpriseAttachmentService.removeByGuids(guids); | ||
| 56 | return CommonRes.success(true); | ||
| 57 | } | ||
| 58 | |||
| 59 | @PostMapping("/page-list") | ||
| 60 | @SystemLog(value = "开发主体附件信息-分页") | ||
| 61 | @Operation(summary = "开发主体附件信息-分页") | ||
| 62 | public CommonRes<PageListVO<EnterpriseAttachmentRSVO>> pageList(@RequestBody @Valid EnterpriseAttachmentQueryVO queryVO) { | ||
| 63 | PageListVO<EnterpriseAttachmentRSVO> pageVO = enterpriseAttachmentService.pageList(queryVO); | ||
| 64 | return CommonRes.success(pageVO); | ||
| 65 | } | ||
| 66 | |||
| 67 | @GetMapping("/detail") | ||
| 68 | @SystemLog(value = "开发主体附件信息-详情") | ||
| 69 | @Operation( | ||
| 70 | summary = "开发主体附件信息-详情", | ||
| 71 | parameters = { | ||
| 72 | @Parameter(name = "guid", description = "开发主体附件信息唯一标识", required = true)} | ||
| 73 | ) | ||
| 74 | public CommonRes<EnterpriseAttachmentRSVO> getEnterpriseAttachmentDetail(@RequestParam String guid) { | ||
| 75 | EnterpriseAttachmentRSVO vo = enterpriseAttachmentService.getEnterpriseAttachmentDetail(guid); | ||
| 76 | return CommonRes.success(vo); | ||
| 77 | } | ||
| 78 | |||
| 79 | //endregion | ||
| 80 | |||
| 81 | } |
| 1 | package com.csbr.qingcloud.portal.domain.vo; | ||
| 2 | |||
| 3 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; | ||
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | import lombok.EqualsAndHashCode; | ||
| 6 | import lombok.Data; | ||
| 7 | import java.math.BigDecimal; | ||
| 8 | import java.util.Date; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: | ||
| 12 | * @description: 开发主体附件信息查询参数 | ||
| 13 | * @author: makejava | ||
| 14 | * @create: 2025-09-05 13:50 | ||
| 15 | **/ | ||
| 16 | @EqualsAndHashCode(callSuper = true) | ||
| 17 | @Data | ||
| 18 | @Schema(title = "开发主体附件信息查询参数") | ||
| 19 | public class EnterpriseAttachmentQueryVO extends BasePageDTO { | ||
| 20 | |||
| 21 | } |
| 1 | package com.csbr.qingcloud.portal.domain.vo; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 5 | import jakarta.validation.constraints.Size; | ||
| 6 | import lombok.Data; | ||
| 7 | import java.math.BigDecimal; | ||
| 8 | import java.util.Date; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: | ||
| 12 | * @description: 开发主体附件信息新增、修改参数 | ||
| 13 | * @author: makejava | ||
| 14 | * @create: 2025-09-05 13:50 | ||
| 15 | **/ | ||
| 16 | @Data | ||
| 17 | @Schema(title = "开发主体附件信息新增、修改参数") | ||
| 18 | public class EnterpriseAttachmentRQVO { | ||
| 19 | |||
| 20 | /** | ||
| 21 | * 系统唯一标识 | ||
| 22 | */ | ||
| 23 | @Schema(description = "系统唯一标识") | ||
| 24 | @Size(max = 32, message = "系统唯一标识长度超过32") | ||
| 25 | private String guid; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * 企业唯一标识 | ||
| 29 | */ | ||
| 30 | @Schema(description = "企业唯一标识") | ||
| 31 | @Size(max = 32, message = "企业唯一标识长度超过32") | ||
| 32 | private String tenantGuid; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * 企业认证唯一标识 | ||
| 36 | */ | ||
| 37 | @Schema(description = "企业认证唯一标识") | ||
| 38 | @Size(max = 32, message = "企业认证唯一标识长度超过32") | ||
| 39 | private String enterpriseGuid; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * 文件名称 | ||
| 43 | */ | ||
| 44 | @Schema(description = "文件名称") | ||
| 45 | @Size(max = 50, message = "文件名称长度超过50") | ||
| 46 | private String fileName; | ||
| 47 | |||
| 48 | /** | ||
| 49 | * 文件类型【详情 开发主体附件类型数据字典】 | ||
| 50 | */ | ||
| 51 | @Schema(description = "文件类型【详情 开发主体附件类型数据字典】") | ||
| 52 | @Size(max = 10, message = "文件类型【详情 开发主体附件类型数据字典】长度超过10") | ||
| 53 | private String fileType; | ||
| 54 | |||
| 55 | /** | ||
| 56 | * 文件大小 | ||
| 57 | */ | ||
| 58 | @Schema(description = "文件大小") | ||
| 59 | private BigDecimal fileSize; | ||
| 60 | |||
| 61 | /** | ||
| 62 | * 文件地址 | ||
| 63 | */ | ||
| 64 | @Schema(description = "文件地址") | ||
| 65 | @Size(max = 500, message = "文件地址长度超过500") | ||
| 66 | private String fileUrl; | ||
| 67 | |||
| 68 | /******** 库表存储属性 需处理 *****/ | ||
| 69 | |||
| 70 | /******** 自定义扩展 *****/ | ||
| 71 | |||
| 72 | /******** 子对象 *****/ | ||
| 73 | |||
| 74 | } |
| 1 | package com.csbr.qingcloud.portal.domain.vo; | ||
| 2 | |||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 5 | import lombok.Data; | ||
| 6 | import java.math.BigDecimal; | ||
| 7 | import java.util.Date; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @program: | ||
| 11 | * @description: 开发主体附件信息返回参数 | ||
| 12 | * @author: makejava | ||
| 13 | * @create: 2025-09-05 13:50 | ||
| 14 | **/ | ||
| 15 | @Data | ||
| 16 | @Schema(title = "开发主体附件信息返回参数") | ||
| 17 | public class EnterpriseAttachmentRSVO { | ||
| 18 | |||
| 19 | /** | ||
| 20 | * 系统唯一标识 | ||
| 21 | */ | ||
| 22 | @Schema(description = "系统唯一标识") | ||
| 23 | private String guid; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * 企业唯一标识 | ||
| 27 | */ | ||
| 28 | @Schema(description = "企业唯一标识") | ||
| 29 | private String tenantGuid; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * 企业认证唯一标识 | ||
| 33 | */ | ||
| 34 | @Schema(description = "企业认证唯一标识") | ||
| 35 | private String enterpriseGuid; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 文件名称 | ||
| 39 | */ | ||
| 40 | @Schema(description = "文件名称") | ||
| 41 | private String fileName; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * 文件类型【详情 开发主体附件类型数据字典】 | ||
| 45 | */ | ||
| 46 | @Schema(description = "文件类型【详情 开发主体附件类型数据字典】") | ||
| 47 | private String fileType; | ||
| 48 | |||
| 49 | /** | ||
| 50 | * 文件大小 | ||
| 51 | */ | ||
| 52 | @Schema(description = "文件大小") | ||
| 53 | private BigDecimal fileSize; | ||
| 54 | |||
| 55 | /** | ||
| 56 | * 文件地址 | ||
| 57 | */ | ||
| 58 | @Schema(description = "文件地址") | ||
| 59 | private String fileUrl; | ||
| 60 | |||
| 61 | /******** 库表存储属性 需处理 *****/ | ||
| 62 | |||
| 63 | /******** 自定义扩展 *****/ | ||
| 64 | |||
| 65 | /******** 子对象 *****/ | ||
| 66 | |||
| 67 | } |
| 1 | package com.csbr.qingcloud.portal.mybatis.entity; | ||
| 2 | |||
| 3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; | ||
| 4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | import csbr.cloud.entity.domain.base.dao.BaseDO; | ||
| 6 | import jdk.jfr.Name; | ||
| 7 | import lombok.Data; | ||
| 8 | import lombok.EqualsAndHashCode; | ||
| 9 | import lombok.experimental.Accessors; | ||
| 10 | import java.math.BigDecimal; | ||
| 11 | import java.util.Date; | ||
| 12 | |||
| 13 | /** | ||
| 14 | * @program: | ||
| 15 | * @description: 开发主体附件信息实体 | ||
| 16 | * @author: makejava | ||
| 17 | * @create: 2025-09-05 13:50 | ||
| 18 | **/ | ||
| 19 | @Data | ||
| 20 | @EqualsAndHashCode(callSuper = true) | ||
| 21 | @Accessors(chain = true) | ||
| 22 | @Name("开发主体附件信息") | ||
| 23 | public class MfEnterpriseAttachment extends BaseDO { | ||
| 24 | |||
| 25 | /** | ||
| 26 | * 企业唯一标识 | ||
| 27 | */ | ||
| 28 | @Name("企业唯一标识") | ||
| 29 | private String tenantGuid; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * 企业认证唯一标识 | ||
| 33 | */ | ||
| 34 | @Name("企业认证唯一标识") | ||
| 35 | private String enterpriseGuid; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 文件名称 | ||
| 39 | */ | ||
| 40 | @Name("文件名称") | ||
| 41 | private String fileName; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * 文件类型【详情 开发主体附件类型数据字典】 | ||
| 45 | */ | ||
| 46 | @Name("文件类型【详情 开发主体附件类型数据字典】") | ||
| 47 | private String fileType; | ||
| 48 | |||
| 49 | /** | ||
| 50 | * 文件大小 | ||
| 51 | */ | ||
| 52 | @Name("文件大小") | ||
| 53 | private BigDecimal fileSize; | ||
| 54 | |||
| 55 | /** | ||
| 56 | * 文件地址 | ||
| 57 | */ | ||
| 58 | @Name("文件地址") | ||
| 59 | private String fileUrl; | ||
| 60 | |||
| 61 | } |
| 1 | package com.csbr.qingcloud.portal.mybatis.mapper; | ||
| 2 | |||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 4 | import org.apache.ibatis.annotations.Mapper; | ||
| 5 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseAttachment; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @program: | ||
| 9 | * @description: 开发主体附件信息 Mapper 接口 | ||
| 10 | * @author: makejava | ||
| 11 | * @create: 2025-09-05 13:50 | ||
| 12 | **/ | ||
| 13 | @Mapper | ||
| 14 | public interface MfEnterpriseAttachmentMapper extends BaseMapper<MfEnterpriseAttachment> { | ||
| 15 | |||
| 16 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/service/MfEnterpriseAttachmentService.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.mybatis.service; | ||
| 2 | |||
| 3 | import com.csbr.cloud.base.service.CsbrService; | ||
| 4 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseAttachment; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: | ||
| 8 | * @description: 开发主体附件信息逻辑层接口 | ||
| 9 | * @author: makejava | ||
| 10 | * @create: 2025-09-05 13:50 | ||
| 11 | **/ | ||
| 12 | public interface MfEnterpriseAttachmentService extends CsbrService<MfEnterpriseAttachment> { | ||
| 13 | |||
| 14 | } |
src/main/java/com/csbr/qingcloud/portal/mybatis/service/impl/MfEnterpriseAttachmentServiceImpl.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.mybatis.service.impl; | ||
| 2 | |||
| 3 | import com.csbr.cloud.mybatis.service.impl.CsbrServiceImpl; | ||
| 4 | import com.csbr.qingcloud.portal.mybatis.mapper.MfEnterpriseAttachmentMapper; | ||
| 5 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseAttachment; | ||
| 6 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseAttachmentService; | ||
| 7 | import jakarta.annotation.Resource; | ||
| 8 | import org.springframework.stereotype.Service; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: | ||
| 12 | * @description: 开发主体附件信息逻辑层接口实现 | ||
| 13 | * @author: makejava | ||
| 14 | * @create: 2025-09-05 13:50 | ||
| 15 | **/ | ||
| 16 | @Service | ||
| 17 | public class MfEnterpriseAttachmentServiceImpl extends CsbrServiceImpl<MfEnterpriseAttachmentMapper, MfEnterpriseAttachment> implements MfEnterpriseAttachmentService { | ||
| 18 | |||
| 19 | @Resource | ||
| 20 | private MfEnterpriseAttachmentMapper mfEnterpriseAttachmentMapper; | ||
| 21 | |||
| 22 | } |
| 1 | package com.csbr.qingcloud.portal.service; | ||
| 2 | |||
| 3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 4 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentQueryVO; | ||
| 5 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRQVO; | ||
| 6 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO; | ||
| 7 | |||
| 8 | import java.util.List; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: | ||
| 12 | * @description: 开发主体附件信息业务逻辑接口 | ||
| 13 | * @author: makejava | ||
| 14 | * @create: 2025-09-05 13:50 | ||
| 15 | **/ | ||
| 16 | public interface EnterpriseAttachmentService { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * 开发主体附件信息分页查询 | ||
| 20 | * @author makejava | ||
| 21 | * @date 2025-09-05 13:50 | ||
| 22 | * @param queryVO | ||
| 23 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO> | ||
| 24 | */ | ||
| 25 | PageListVO<EnterpriseAttachmentRSVO> pageList(EnterpriseAttachmentQueryVO queryVO); | ||
| 26 | |||
| 27 | /** | ||
| 28 | * 开发主体附件信息获取详情数据 | ||
| 29 | * @author makejava | ||
| 30 | * @date 2025-09-05 13:50 | ||
| 31 | * @param guid | ||
| 32 | * @return com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO | ||
| 33 | */ | ||
| 34 | EnterpriseAttachmentRSVO getEnterpriseAttachmentDetail(String guid); | ||
| 35 | |||
| 36 | /** | ||
| 37 | * 开发主体附件信息数据新增 | ||
| 38 | * @author makejava | ||
| 39 | * @date 2025-09-05 13:50 | ||
| 40 | * @param rqVO | ||
| 41 | * @return boolean | ||
| 42 | */ | ||
| 43 | void saveEnterpriseAttachment(EnterpriseAttachmentRQVO rqVO); | ||
| 44 | |||
| 45 | /** | ||
| 46 | * 开发主体附件信息数据修改 | ||
| 47 | * @author makejava | ||
| 48 | * @date 2025-09-05 13:50 | ||
| 49 | * @param rqVO | ||
| 50 | * @return boolean | ||
| 51 | */ | ||
| 52 | void updateEnterpriseAttachment(EnterpriseAttachmentRQVO rqVO); | ||
| 53 | |||
| 54 | /** | ||
| 55 | * 开发主体附件信息数据删除 | ||
| 56 | * @author makejava | ||
| 57 | * @date 2025-09-05 13:50 | ||
| 58 | * @param guids | ||
| 59 | * @return void | ||
| 60 | */ | ||
| 61 | void removeByGuids(List<String> guids); | ||
| 62 | |||
| 63 | /** | ||
| 64 | * 开发主体附件信息数据删除、并有相关的处理操作 | ||
| 65 | * @author makejava | ||
| 66 | * @date 2025-09-05 13:50 | ||
| 67 | * @param guids | ||
| 68 | * @return void | ||
| 69 | */ | ||
| 70 | void removeHandleByGuids(List<String> guids); | ||
| 71 | |||
| 72 | } |
src/main/java/com/csbr/qingcloud/portal/service/impl/EnterpriseAttachmentServiceImpl.java
0 → 100644
| 1 | package com.csbr.qingcloud.portal.service.impl; | ||
| 2 | |||
| 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | import com.csbr.cloud.common.enums.SystemError; | ||
| 5 | import com.csbr.cloud.common.exception.CsbrSystemException; | ||
| 6 | import com.csbr.cloud.common.util.CommonUtil; | ||
| 7 | import com.csbr.cloud.common.util.CsbrBeanUtil; | ||
| 8 | import com.csbr.cloud.common.util.MessageSourceUtil; | ||
| 9 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 10 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentQueryVO; | ||
| 11 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRQVO; | ||
| 12 | import com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO; | ||
| 13 | import com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseAttachment; | ||
| 14 | import com.csbr.qingcloud.portal.mybatis.service.MfEnterpriseAttachmentService; | ||
| 15 | import com.csbr.qingcloud.portal.service.EnterpriseAttachmentService; | ||
| 16 | import jakarta.annotation.Resource; | ||
| 17 | import lombok.extern.slf4j.Slf4j; | ||
| 18 | import org.apache.commons.collections.CollectionUtils; | ||
| 19 | import org.apache.commons.lang3.StringUtils; | ||
| 20 | import org.springframework.stereotype.Service; | ||
| 21 | import org.springframework.transaction.annotation.Transactional; | ||
| 22 | |||
| 23 | import java.util.ArrayList; | ||
| 24 | import java.util.Collections; | ||
| 25 | import java.util.List; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * @program: | ||
| 29 | * @description: 开发主体附件信息业务逻辑实现 | ||
| 30 | * @author: makejava | ||
| 31 | * @create: 2025-09-05 13:50 | ||
| 32 | **/ | ||
| 33 | @Slf4j | ||
| 34 | @Service | ||
| 35 | public class EnterpriseAttachmentServiceImpl implements EnterpriseAttachmentService { | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 功能名称 | ||
| 39 | */ | ||
| 40 | private static final String FUNCTION_NAME = "开发主体附件信息"; | ||
| 41 | |||
| 42 | @Resource | ||
| 43 | private MfEnterpriseAttachmentService mfEnterpriseAttachmentService; | ||
| 44 | |||
| 45 | @Resource | ||
| 46 | private CsbrBeanUtil csbrBeanUtil; | ||
| 47 | |||
| 48 | @Resource | ||
| 49 | private MessageSourceUtil messageSourceUtil; | ||
| 50 | |||
| 51 | /** | ||
| 52 | * 开发主体附件信息分页查询 | ||
| 53 | * @author makejava | ||
| 54 | * @date 2025-09-05 13:50 | ||
| 55 | * @param queryVO | ||
| 56 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO> | ||
| 57 | */ | ||
| 58 | @Override | ||
| 59 | public PageListVO<EnterpriseAttachmentRSVO> pageList(EnterpriseAttachmentQueryVO queryVO) { | ||
| 60 | beforeQuery(queryVO); | ||
| 61 | LambdaQueryWrapper<MfEnterpriseAttachment> queryWrapper = mfEnterpriseAttachmentService.csbrQueryWrapper(queryVO, MfEnterpriseAttachment.class); | ||
| 62 | queryWrapper.orderByDesc(MfEnterpriseAttachment::getCreateTime); | ||
| 63 | PageListVO<MfEnterpriseAttachment> pageList = mfEnterpriseAttachmentService.csbrPageList(queryVO, queryWrapper); | ||
| 64 | PageListVO<EnterpriseAttachmentRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | ||
| 65 | afterQuery(pageList, rsPageList); | ||
| 66 | return rsPageList; | ||
| 67 | } | ||
| 68 | |||
| 69 | /** | ||
| 70 | * 开发主体附件信息获取详情数据 | ||
| 71 | * @author makejava | ||
| 72 | * @date 2025-09-05 13:50 | ||
| 73 | * @param guid | ||
| 74 | * @return com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO | ||
| 75 | */ | ||
| 76 | @Override | ||
| 77 | public EnterpriseAttachmentRSVO getEnterpriseAttachmentDetail(String guid) { | ||
| 78 | if (StringUtils.isBlank(guid)) { | ||
| 79 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 80 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", | ||
| 81 | String.format("获取%s详情数据", FUNCTION_NAME), "数据唯一标识")); | ||
| 82 | } | ||
| 83 | MfEnterpriseAttachment entity = mfEnterpriseAttachmentService.getById(guid); | ||
| 84 | if (entity == null) { | ||
| 85 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(String.format("获取%s详情数据", FUNCTION_NAME))); | ||
| 86 | } | ||
| 87 | return convertToVO(entity); | ||
| 88 | } | ||
| 89 | |||
| 90 | /** | ||
| 91 | * 开发主体附件信息数据新增 | ||
| 92 | * @author makejava | ||
| 93 | * @date 2025-09-05 13:50 | ||
| 94 | * @param rqVO | ||
| 95 | * @return boolean | ||
| 96 | */ | ||
| 97 | @Transactional(rollbackFor = Exception.class) | ||
| 98 | @Override | ||
| 99 | public void saveEnterpriseAttachment(EnterpriseAttachmentRQVO rqVO) { | ||
| 100 | beforeSave(rqVO); | ||
| 101 | MfEnterpriseAttachment entity = convertToEntity(rqVO); | ||
| 102 | mfEnterpriseAttachmentService.csbrAddEntity(entity); | ||
| 103 | boolean flag = mfEnterpriseAttachmentService.save(entity); | ||
| 104 | if (!flag) { | ||
| 105 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(FUNCTION_NAME)); | ||
| 106 | } | ||
| 107 | afterSave(rqVO); | ||
| 108 | } | ||
| 109 | |||
| 110 | /** | ||
| 111 | * 开发主体附件信息数据修改 | ||
| 112 | * @author makejava | ||
| 113 | * @date 2025-09-05 13:50 | ||
| 114 | * @param rqVO | ||
| 115 | * @return boolean | ||
| 116 | */ | ||
| 117 | @Transactional(rollbackFor = Exception.class) | ||
| 118 | @Override | ||
| 119 | public void updateEnterpriseAttachment(EnterpriseAttachmentRQVO rqVO) { | ||
| 120 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | ||
| 121 | // MfEnterpriseAttachment oldEntity = mfEnterpriseAttachmentService.getById(rqVO.getGuid()); | ||
| 122 | MfEnterpriseAttachment oldEntity = null; | ||
| 123 | beforeUpdate(rqVO); | ||
| 124 | MfEnterpriseAttachment entity = convertToEntity(rqVO); | ||
| 125 | mfEnterpriseAttachmentService.csbrUpdateEntity(entity); | ||
| 126 | boolean flag = mfEnterpriseAttachmentService.updateById(entity); | ||
| 127 | if (!flag) { | ||
| 128 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
| 129 | } | ||
| 130 | afterUpdate(rqVO, oldEntity); | ||
| 131 | } | ||
| 132 | |||
| 133 | /** | ||
| 134 | * 开发主体附件信息数据删除 | ||
| 135 | * @author makejava | ||
| 136 | * @date 2025-09-05 13:50 | ||
| 137 | * @param guids | ||
| 138 | * @return void | ||
| 139 | */ | ||
| 140 | @Transactional(rollbackFor = Exception.class) | ||
| 141 | @Override | ||
| 142 | public void removeByGuids(List<String> guids) { | ||
| 143 | if (CollectionUtils.isEmpty(guids)) { | ||
| 144 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 145 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
| 146 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
| 147 | } | ||
| 148 | if (!mfEnterpriseAttachmentService.isExistsData(guids, MfEnterpriseAttachment.class)) { | ||
| 149 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
| 150 | } | ||
| 151 | boolean flag = mfEnterpriseAttachmentService.removeByIds(guids); | ||
| 152 | if (!flag) { | ||
| 153 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 | /** | ||
| 158 | * 开发主体附件信息数据删除、并有相关的处理操作 | ||
| 159 | * @author makejava | ||
| 160 | * @date 2025-09-05 13:50 | ||
| 161 | * @param guids | ||
| 162 | * @return void | ||
| 163 | */ | ||
| 164 | @Transactional(rollbackFor = Exception.class) | ||
| 165 | @Override | ||
| 166 | public void removeHandleByGuids(List<String> guids) { | ||
| 167 | if (CollectionUtils.isEmpty(guids)) { | ||
| 168 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 169 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
| 170 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
| 171 | } | ||
| 172 | for (String guid : guids) { | ||
| 173 | MfEnterpriseAttachment entity = mfEnterpriseAttachmentService.getById(guid); | ||
| 174 | beforeRemove(entity); | ||
| 175 | boolean flag = mfEnterpriseAttachmentService.removeById(guid); | ||
| 176 | if (!flag) { | ||
| 177 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | ||
| 178 | } | ||
| 179 | afterRemove(entity); | ||
| 180 | } | ||
| 181 | } | ||
| 182 | |||
| 183 | /** | ||
| 184 | * 开发主体附件信息新新增前置处理 | ||
| 185 | * @author makejava | ||
| 186 | * @date 2025-09-05 13:50 | ||
| 187 | * @param rqVO | ||
| 188 | * @return void | ||
| 189 | */ | ||
| 190 | private void beforeSave(EnterpriseAttachmentRQVO rqVO) { | ||
| 191 | //region 1.输入基础验证 | ||
| 192 | //endregion | ||
| 193 | |||
| 194 | //region 2.数据验证特殊处理 | ||
| 195 | //region 2.1.业务合规性验证 | ||
| 196 | //endregion 2.1.业务合规性验证 | ||
| 197 | |||
| 198 | //region 2.2.业务数据验证 | ||
| 199 | //endregion 2.2.业务数据验证 | ||
| 200 | |||
| 201 | //endregion 2.数据验证特殊处理 | ||
| 202 | |||
| 203 | //region 3.数据转换处理 | ||
| 204 | |||
| 205 | //region 3.1.数据过程转换 | ||
| 206 | //endregion 3.1.数据过程转换 | ||
| 207 | |||
| 208 | //endregion 3.数据转换处理 | ||
| 209 | |||
| 210 | //region 4.数据过滤与补充处理 | ||
| 211 | |||
| 212 | //endregion 4.数据过滤与补充处理 | ||
| 213 | |||
| 214 | //region 5.过程处理 | ||
| 215 | |||
| 216 | //region 5.1.计算逻辑处理 | ||
| 217 | //endregion 5.1.计算逻辑处理 | ||
| 218 | |||
| 219 | //region 5.2.业务逻辑处理 | ||
| 220 | //endregion 5.2.业务逻辑处理 | ||
| 221 | |||
| 222 | //endregion 5.过程处理 | ||
| 223 | } | ||
| 224 | |||
| 225 | /** | ||
| 226 | * 开发主体附件信息新增后置处理 | ||
| 227 | * @author makejava | ||
| 228 | * @date 2025-09-05 13:50 | ||
| 229 | * @param rqVO | ||
| 230 | * @return void | ||
| 231 | */ | ||
| 232 | private void afterSave(EnterpriseAttachmentRQVO rqVO) { | ||
| 233 | //region 1.输出特殊转换 | ||
| 234 | |||
| 235 | //region 1.1.输出过滤与补充处理 | ||
| 236 | //endregion 1.1.输出过滤与补充处理 | ||
| 237 | |||
| 238 | //endregion 1.输出特殊转换 | ||
| 239 | } | ||
| 240 | |||
| 241 | /** | ||
| 242 | * 开发主体附件信息修改前置校验、处理 | ||
| 243 | * @author makejava | ||
| 244 | * @date 2025-09-05 13:50 | ||
| 245 | * @param rqVO | ||
| 246 | * @return void | ||
| 247 | */ | ||
| 248 | private void beforeUpdate(EnterpriseAttachmentRQVO rqVO) { | ||
| 249 | //region 1.输入基础验证 | ||
| 250 | if (StringUtils.isBlank(rqVO.getGuid())) { | ||
| 251 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 252 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00010", String.format("修改%s数据",FUNCTION_NAME), "数据唯一标识")); | ||
| 253 | } | ||
| 254 | //endregion | ||
| 255 | |||
| 256 | //region 2.数据验证特殊处理 | ||
| 257 | //region 2.1.业务合规性验证 | ||
| 258 | //endregion 2.1.业务合规性验证 | ||
| 259 | |||
| 260 | //region 2.2.业务数据验证 | ||
| 261 | if (!mfEnterpriseAttachmentService.isExistsData(Collections.singletonList(rqVO.getGuid()), MfEnterpriseAttachment.class)) { | ||
| 262 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | ||
| 263 | } | ||
| 264 | //endregion 2.2.业务数据验证 | ||
| 265 | |||
| 266 | //endregion 2.数据验证特殊处理 | ||
| 267 | |||
| 268 | //region 3.数据转换处理 | ||
| 269 | |||
| 270 | //region 3.1.数据过程转换 | ||
| 271 | //endregion 3.1.数据过程转换 | ||
| 272 | |||
| 273 | //endregion 3.数据转换处理 | ||
| 274 | |||
| 275 | //region 4.数据过滤与补充处理 | ||
| 276 | //endregion 4.数据过滤与补充处理 | ||
| 277 | |||
| 278 | //region 5.过程处理 | ||
| 279 | |||
| 280 | //region 5.1.计算逻辑处理 | ||
| 281 | //endregion 5.1.计算逻辑处理 | ||
| 282 | |||
| 283 | //region 5.2.业务逻辑处理 | ||
| 284 | //endregion 5.2.业务逻辑处理 | ||
| 285 | |||
| 286 | //endregion 5.过程处理 | ||
| 287 | } | ||
| 288 | |||
| 289 | /** | ||
| 290 | * 开发主体附件信息修改后置处理 | ||
| 291 | * @author makejava | ||
| 292 | * @date 2025-09-05 13:50 | ||
| 293 | * @param rqVO | ||
| 294 | * @param entity | ||
| 295 | * @return void | ||
| 296 | */ | ||
| 297 | protected void afterUpdate(EnterpriseAttachmentRQVO rqVO, MfEnterpriseAttachment entity) { | ||
| 298 | //region 1.输出特殊转换 | ||
| 299 | |||
| 300 | //region 1.1.输出过滤与补充处理 | ||
| 301 | //endregion 1.1.输出过滤与补充处理 | ||
| 302 | |||
| 303 | //endregion 1.输出特殊转换 | ||
| 304 | } | ||
| 305 | |||
| 306 | |||
| 307 | /** | ||
| 308 | * 开发主体附件信息删除前置处理 | ||
| 309 | * @author makejava | ||
| 310 | * @date 2025-09-05 13:50 | ||
| 311 | * @param entity | ||
| 312 | * @return void | ||
| 313 | */ | ||
| 314 | private void beforeRemove(MfEnterpriseAttachment entity) { | ||
| 315 | if (entity == null) { | ||
| 316 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
| 317 | } | ||
| 318 | } | ||
| 319 | |||
| 320 | /** | ||
| 321 | * 开发主体附件信息删除后置处理 | ||
| 322 | * @author makejava | ||
| 323 | * @date 2025-09-05 13:50 | ||
| 324 | * @param entity | ||
| 325 | * @return void | ||
| 326 | */ | ||
| 327 | private void afterRemove(MfEnterpriseAttachment entity) { | ||
| 328 | |||
| 329 | } | ||
| 330 | |||
| 331 | /** | ||
| 332 | * 开发主体附件信息查询方法前置验证、处理 | ||
| 333 | * @author makejava | ||
| 334 | * @date 2025-09-05 13:50 | ||
| 335 | * @param rqQueryVO | ||
| 336 | * @return void | ||
| 337 | */ | ||
| 338 | private void beforeQuery(EnterpriseAttachmentQueryVO rqQueryVO) { | ||
| 339 | |||
| 340 | } | ||
| 341 | |||
| 342 | /** | ||
| 343 | * 开发主体附件信息查询方法后置数据转换、处理 | ||
| 344 | * @author makejava | ||
| 345 | * @date 2025-09-05 13:50 | ||
| 346 | * @param pageList 数据库查询数据 | ||
| 347 | * @param rsPageList 返回的最终数据 | ||
| 348 | * @return void | ||
| 349 | */ | ||
| 350 | private void afterQuery(PageListVO<MfEnterpriseAttachment> pageList, PageListVO<EnterpriseAttachmentRSVO> rsPageList) { | ||
| 351 | if (CollectionUtils.isNotEmpty(pageList.getRecords())) { | ||
| 352 | rsPageList.setRecords(convertToVO(pageList.getRecords())); | ||
| 353 | } | ||
| 354 | // 需要特殊处理数据时使用 | ||
| 355 | /*if(CollectionUtils.isNotEmpty(pageList.getRecords())){ | ||
| 356 | List<EnterpriseAttachmentRSVO> results = new ArrayList<>(); | ||
| 357 | for (MfEnterpriseAttachment item : pageList.getRecords()){ | ||
| 358 | EnterpriseAttachmentRSVO vo = convertToVO(item); | ||
| 359 | results.add(vo); | ||
| 360 | } | ||
| 361 | rsPageList.setRecords(results); | ||
| 362 | }*/ | ||
| 363 | } | ||
| 364 | |||
| 365 | //region 辅助操作 | ||
| 366 | |||
| 367 | /** | ||
| 368 | * 开发主体附件信息实体数据转换为视图对象数据(多个) | ||
| 369 | * @author makejava | ||
| 370 | * @date 2025-09-05 13:50 | ||
| 371 | * @param entityList 实体数据列表 | ||
| 372 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO> 视图对象列表 | ||
| 373 | */ | ||
| 374 | private List<EnterpriseAttachmentRSVO> convertToVO(List<MfEnterpriseAttachment> entityList) { | ||
| 375 | if (CollectionUtils.isEmpty(entityList)) { | ||
| 376 | // W00012 = {0}:参数[{1}]不能为空! | ||
| 377 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | ||
| 378 | "实体数据转换为视图对象实体数据", "实体数据")); | ||
| 379 | } | ||
| 380 | List<EnterpriseAttachmentRSVO> voList = new ArrayList<>(entityList.size()); | ||
| 381 | for (MfEnterpriseAttachment item : entityList) { | ||
| 382 | EnterpriseAttachmentRSVO vo = convertToVO(item); | ||
| 383 | voList.add(vo); | ||
| 384 | } | ||
| 385 | return voList; | ||
| 386 | } | ||
| 387 | |||
| 388 | /** | ||
| 389 | * 开发主体附件信息实体数据转换为视图对象数据 | ||
| 390 | * @author makejava | ||
| 391 | * @date 2025-09-05 13:50 | ||
| 392 | * @param entity | ||
| 393 | * @return com.csbr.qingcloud.portal.domain.vo.EnterpriseAttachmentRSVO | ||
| 394 | */ | ||
| 395 | private EnterpriseAttachmentRSVO convertToVO(MfEnterpriseAttachment entity) { | ||
| 396 | EnterpriseAttachmentRSVO vo = csbrBeanUtil.convert(entity, EnterpriseAttachmentRSVO.class); | ||
| 397 | return vo; | ||
| 398 | } | ||
| 399 | |||
| 400 | /** | ||
| 401 | * 开发主体附件信息新增、修改和其他情况的参数转换为实体 | ||
| 402 | * @author makejava | ||
| 403 | * @date 2025-09-05 13:50 | ||
| 404 | * @param vo | ||
| 405 | * @return com.csbr.qingcloud.portal.mybatis.entity.MfEnterpriseAttachment | ||
| 406 | */ | ||
| 407 | private MfEnterpriseAttachment convertToEntity(EnterpriseAttachmentRQVO vo) { | ||
| 408 | MfEnterpriseAttachment entity = csbrBeanUtil.convert(vo, MfEnterpriseAttachment.class); | ||
| 409 | // 新增时数据默认guid赋值,转换后该guid可能别使用 | ||
| 410 | if (StringUtils.isBlank(vo.getGuid())) { | ||
| 411 | entity.setGuid(CommonUtil.newGuid()); | ||
| 412 | } | ||
| 413 | return entity; | ||
| 414 | } | ||
| 415 | |||
| 416 | //endregion | ||
| 417 | |||
| 418 | } |
-
Please register or sign in to post a comment