Commit 1d642251720a5e0f15918f79e33aef51e1479885
1 parent
3b7a4129
refactor(storage): 重构业务配置相关代码结构
- 移除 TaxPipelineBusinessResponse 中的 configs 和 businessExt 字段 - 删除 TaxPipelineBusinessConfigCO、TaxPipelineBusinessExtCO 等配置类 - 清理控制器中与业务文档和扩展相关的接口方法 - 移除 TaxPipelineBusinessConfigRepository 等冗余仓储接口 - 简化服务层对业务配置和扩展信息的处理逻辑 - 调整 VO 类字段类型及注释,提升数据一致性 - 优化 TaxPipelineVO 和 TaxTenantVO 的字段描述和结构
Showing
16 changed files
with
44 additions
and
513 deletions
tax-storage/src/main/java/com/diligrp/tax/storage/api/response/PipelineBusinessResponse.java
| 1 | package com.diligrp.tax.storage.api.response; | 1 | package com.diligrp.tax.storage.api.response; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.type.DocumentType; | ||
| 4 | -import com.diligrp.tax.storage.model.vo.TaxPipelineBusinessExtVO; | ||
| 5 | import lombok.Getter; | 3 | import lombok.Getter; |
| 6 | import lombok.Setter; | 4 | import lombok.Setter; |
| 7 | 5 | ||
| 8 | -import java.util.List; | ||
| 9 | - | ||
| 10 | /** | 6 | /** |
| 11 | * @Author: zhangmeiyang | 7 | * @Author: zhangmeiyang |
| 12 | * @CreateTime: 2025-11-13 18:21 | 8 | * @CreateTime: 2025-11-13 18:21 |
| @@ -34,15 +30,4 @@ public class PipelineBusinessResponse { | @@ -34,15 +30,4 @@ public class PipelineBusinessResponse { | ||
| 34 | * 业务名称 | 30 | * 业务名称 |
| 35 | */ | 31 | */ |
| 36 | private String businessName; | 32 | private String businessName; |
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * 配置 | ||
| 40 | - */ | ||
| 41 | - private List<String> configs; | ||
| 42 | - | ||
| 43 | - | ||
| 44 | - /** | ||
| 45 | - * 业务扩展 | ||
| 46 | - */ | ||
| 47 | - private List<TaxPipelineBusinessExtVO> businessExt; | ||
| 48 | } | 33 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/controller/TaxPipelineBusinessConfigController.java
| @@ -72,79 +72,6 @@ public class TaxPipelineBusinessConfigController { | @@ -72,79 +72,6 @@ public class TaxPipelineBusinessConfigController { | ||
| 72 | return Message.success(taxPipelineBusinessConfigService.pageBusiness(co)); | 72 | return Message.success(taxPipelineBusinessConfigService.pageBusiness(co)); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | - | ||
| 76 | - /** | ||
| 77 | - * 保存业务文档 | ||
| 78 | - * | ||
| 79 | - * @param co 公司 | ||
| 80 | - * @return {@link Message }<{@link ? }> | ||
| 81 | - */ | ||
| 82 | - @RequestMapping("/saveBusinessDocument") | ||
| 83 | - public Message<?> saveBusinessDocument(@RequestBody @Validated(value = Valid.Create.class) TaxPipelineBusinessConfigCO co) { | ||
| 84 | - taxPipelineBusinessConfigService.saveBusinessDocument(co); | ||
| 85 | - return Message.success(); | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | - * 保存业务扩展信息 | ||
| 90 | - * | ||
| 91 | - * @param co 公司 | ||
| 92 | - * @return {@link Message }<{@link ? }> | ||
| 93 | - */ | ||
| 94 | - @RequestMapping("/ext/saveBusinessExt") | ||
| 95 | - public Message<?> saveBusinessExt(@RequestBody @Validated(value = Valid.Create.class) TaxPipelineBusinessExtCO co) { | ||
| 96 | - taxPipelineBusinessConfigService.saveBusinessExt(co); | ||
| 97 | - return Message.success(); | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - /** | ||
| 101 | - * 设置业务分机数据 | ||
| 102 | - * | ||
| 103 | - * @param co 公司 | ||
| 104 | - * @return {@link Message }<{@link ? }> | ||
| 105 | - */ | ||
| 106 | - @RequestMapping("/ext/updateBusinessExt") | ||
| 107 | - public Message<?> setBusinessExtData(@RequestBody @Validated(value = Valid.Update.class) TaxPipelineBusinessExtCO co) { | ||
| 108 | - taxPipelineBusinessConfigService.updateBusinessExt(co); | ||
| 109 | - return Message.success(); | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - /** | ||
| 113 | - * 设置默认业务扩展数据 | ||
| 114 | - * | ||
| 115 | - * @param co 公司 | ||
| 116 | - * @return {@link Message }<{@link ? }> | ||
| 117 | - */ | ||
| 118 | - @RequestMapping("/ext/setDefaultBusinessExtData") | ||
| 119 | - public Message<?> setDefaultBusinessExtData(@RequestBody @Validated(value = Valid.Update.class) TaxPipelineBusinessExtDefaultDataCO co) { | ||
| 120 | - taxPipelineBusinessConfigService.setDefaultBusinessExtData(co); | ||
| 121 | - return Message.success(); | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - /** | ||
| 125 | - * 删除业务扩展 | ||
| 126 | - * | ||
| 127 | - * @param co 公司 | ||
| 128 | - * @return {@link Message }<{@link ? }> | ||
| 129 | - */ | ||
| 130 | - @RequestMapping("/ext/deleteBusinessExt") | ||
| 131 | - public Message<?> deleteBusinessExt(@RequestBody @Validated(value = Valid.Update.class) TaxPipelineBusinessExtCO co) { | ||
| 132 | - taxPipelineBusinessConfigService.deleteBusinessExt(co); | ||
| 133 | - return Message.success(); | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - /** | ||
| 137 | - * 刷新业务分机数据 | ||
| 138 | - * | ||
| 139 | - * @param co 公司 | ||
| 140 | - * @return {@link Message }<{@link ? }> | ||
| 141 | - */ | ||
| 142 | - @RequestMapping("/ext/refreshBusinessExtData") | ||
| 143 | - public Message<?> refreshBusinessExtData(@RequestBody @Validated(value = Valid.Update.class) TaxPipelineBusinessExtCO co) { | ||
| 144 | - taxPipelineBusinessConfigService.refreshBusinessExtData(co); | ||
| 145 | - return Message.success(); | ||
| 146 | - } | ||
| 147 | - | ||
| 148 | /** | 75 | /** |
| 149 | * 批量保存业务关键字 | 76 | * 批量保存业务关键字 |
| 150 | * | 77 | * |
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineBusinessConfigCO.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.model.co; | ||
| 2 | - | ||
| 3 | -import com.diligrp.tax.central.message.Valid; | ||
| 4 | -import jakarta.validation.constraints.NotEmpty; | ||
| 5 | -import jakarta.validation.constraints.NotNull; | ||
| 6 | -import lombok.Getter; | ||
| 7 | -import lombok.Setter; | ||
| 8 | - | ||
| 9 | -import java.util.List; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 账套业务配置 | ||
| 13 | - * | ||
| 14 | - * @TableName tax_pipeline_business_config | ||
| 15 | - */ | ||
| 16 | -@Getter | ||
| 17 | -@Setter | ||
| 18 | -public class TaxPipelineBusinessConfigCO { | ||
| 19 | - /** | ||
| 20 | - * | ||
| 21 | - */ | ||
| 22 | - private Long id; | ||
| 23 | - | ||
| 24 | - /** | ||
| 25 | - * 业务ID | ||
| 26 | - */ | ||
| 27 | - @NotNull(groups = {Valid.Create.class, Valid.Update.class}) | ||
| 28 | - private Long taxPipelineBusinessId; | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 单据配置 | ||
| 32 | - */ | ||
| 33 | - @NotEmpty(groups = {Valid.Create.class, Valid.Update.class}) | ||
| 34 | - private List<String> documentTypes; | ||
| 35 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineBusinessExtCO.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.model.co; | ||
| 2 | - | ||
| 3 | -import com.diligrp.tax.central.message.Valid; | ||
| 4 | -import jakarta.validation.constraints.NotEmpty; | ||
| 5 | -import jakarta.validation.constraints.NotNull; | ||
| 6 | -import lombok.Getter; | ||
| 7 | -import lombok.Setter; | ||
| 8 | - | ||
| 9 | -import java.util.List; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * @Author: zhangmeiyang | ||
| 13 | - * @CreateTime: 2025-11-13 17:50 | ||
| 14 | - * @Version: todo | ||
| 15 | - */ | ||
| 16 | -@Getter | ||
| 17 | -@Setter | ||
| 18 | -public class TaxPipelineBusinessExtCO { | ||
| 19 | - | ||
| 20 | - @NotNull(groups = {Valid.Update.class}) | ||
| 21 | - private Long id; | ||
| 22 | - /** | ||
| 23 | - * 业务ID | ||
| 24 | - */ | ||
| 25 | - @NotNull(groups = {Valid.Create.class, Valid.Update.class}) | ||
| 26 | - private Long taxPipelineBusinessId; | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * 扩展名字 | ||
| 30 | - */ | ||
| 31 | - @NotEmpty(groups = {Valid.Create.class}) | ||
| 32 | - private String extName; | ||
| 33 | - | ||
| 34 | - /** | ||
| 35 | - * 扩展编码 | ||
| 36 | - */ | ||
| 37 | - @NotEmpty(groups = {Valid.Create.class}) | ||
| 38 | - private String extCode; | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * 扩展可选数据 | ||
| 42 | - */ | ||
| 43 | - @NotEmpty(groups = {Valid.Create.class, Valid.Update.class}) | ||
| 44 | - private List<String> extDatas; | ||
| 45 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineBusinessExtDefaultDataCO.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.model.co; | ||
| 2 | - | ||
| 3 | -import jakarta.validation.constraints.NotEmpty; | ||
| 4 | -import jakarta.validation.constraints.NotNull; | ||
| 5 | -import lombok.Getter; | ||
| 6 | -import lombok.Setter; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * @Author: zhangmeiyang | ||
| 10 | - * @CreateTime: 2025-11-13 17:50 | ||
| 11 | - * @Version: todo | ||
| 12 | - */ | ||
| 13 | -@Getter | ||
| 14 | -@Setter | ||
| 15 | -public class TaxPipelineBusinessExtDefaultDataCO { | ||
| 16 | - | ||
| 17 | - /** | ||
| 18 | - * id | ||
| 19 | - */ | ||
| 20 | - @NotNull | ||
| 21 | - private Long id; | ||
| 22 | - /** | ||
| 23 | - * 业务ID | ||
| 24 | - */ | ||
| 25 | - @NotNull | ||
| 26 | - private Long taxPipelineBusinessId; | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * 扩展默认数据 | ||
| 30 | - */ | ||
| 31 | - @NotEmpty | ||
| 32 | - private String extDefaultData; | ||
| 33 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineBusinessConfigVO.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.model.vo; | ||
| 2 | - | ||
| 3 | -import lombok.Getter; | ||
| 4 | -import lombok.Setter; | ||
| 5 | - | ||
| 6 | -import java.time.LocalDateTime; | ||
| 7 | - | ||
| 8 | -@Getter | ||
| 9 | -@Setter | ||
| 10 | -public class TaxPipelineBusinessConfigVO { | ||
| 11 | - /** | ||
| 12 | - * | ||
| 13 | - */ | ||
| 14 | - private Long id; | ||
| 15 | - | ||
| 16 | - /** | ||
| 17 | - * 业务ID | ||
| 18 | - */ | ||
| 19 | - private Long taxPipelineBusinessId; | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 单据配置 | ||
| 23 | - */ | ||
| 24 | - private String documentType; | ||
| 25 | - | ||
| 26 | - /** | ||
| 27 | - * 创建时间 | ||
| 28 | - */ | ||
| 29 | - private LocalDateTime createdTime; | ||
| 30 | - | ||
| 31 | - /** | ||
| 32 | - * 更新时间 | ||
| 33 | - */ | ||
| 34 | - private LocalDateTime modifiedTime; | ||
| 35 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineBusinessExtVO.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.model.vo; | ||
| 2 | - | ||
| 3 | -import lombok.Getter; | ||
| 4 | -import lombok.Setter; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 账套业务配置 | ||
| 8 | - * | ||
| 9 | - * @TableName tax_pipeline_business_ext | ||
| 10 | - */ | ||
| 11 | -@Getter | ||
| 12 | -@Setter | ||
| 13 | -public class TaxPipelineBusinessExtVO { | ||
| 14 | - /** | ||
| 15 | - * | ||
| 16 | - */ | ||
| 17 | - private Long id; | ||
| 18 | - | ||
| 19 | - /** | ||
| 20 | - * 业务ID | ||
| 21 | - */ | ||
| 22 | - private Long taxPipelineBusinessId; | ||
| 23 | - | ||
| 24 | - /** | ||
| 25 | - * 扩展名字 | ||
| 26 | - */ | ||
| 27 | - private String extName; | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 扩展编码 | ||
| 31 | - */ | ||
| 32 | - private String extCode; | ||
| 33 | - | ||
| 34 | - /** | ||
| 35 | - * 扩展默认数据 | ||
| 36 | - */ | ||
| 37 | - private String extDefaultData; | ||
| 38 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineBusinessKeywordVO.java
| @@ -12,7 +12,10 @@ import lombok.Setter; | @@ -12,7 +12,10 @@ import lombok.Setter; | ||
| 12 | @Setter | 12 | @Setter |
| 13 | public class TaxPipelineBusinessKeywordVO { | 13 | public class TaxPipelineBusinessKeywordVO { |
| 14 | 14 | ||
| 15 | - private Integer id; | 15 | + /** |
| 16 | + * id | ||
| 17 | + */ | ||
| 18 | + private Long id; | ||
| 16 | /** | 19 | /** |
| 17 | * 业务id | 20 | * 业务id |
| 18 | */ | 21 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineBusinessVO.java
| @@ -4,7 +4,6 @@ import lombok.Getter; | @@ -4,7 +4,6 @@ import lombok.Getter; | ||
| 4 | import lombok.Setter; | 4 | import lombok.Setter; |
| 5 | 5 | ||
| 6 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 7 | -import java.util.List; | ||
| 8 | 7 | ||
| 9 | /** | 8 | /** |
| 10 | * 账套业务配置 | 9 | * 账套业务配置 |
| @@ -43,9 +42,4 @@ public class TaxPipelineBusinessVO { | @@ -43,9 +42,4 @@ public class TaxPipelineBusinessVO { | ||
| 43 | * 更新时间 | 42 | * 更新时间 |
| 44 | */ | 43 | */ |
| 45 | private LocalDateTime modifiedTime; | 44 | private LocalDateTime modifiedTime; |
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 配置 | ||
| 49 | - */ | ||
| 50 | - private List<TaxPipelineBusinessConfigVO> configs; | ||
| 51 | } | 45 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineFieldVerifyReturnVO.java
| @@ -14,7 +14,7 @@ import java.time.LocalDateTime; | @@ -14,7 +14,7 @@ import java.time.LocalDateTime; | ||
| 14 | @Setter | 14 | @Setter |
| 15 | public class TaxPipelineFieldVerifyReturnVO { | 15 | public class TaxPipelineFieldVerifyReturnVO { |
| 16 | /** | 16 | /** |
| 17 | - * | 17 | + *id |
| 18 | */ | 18 | */ |
| 19 | private Long id; | 19 | private Long id; |
| 20 | 20 |
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineVO.java
| @@ -3,37 +3,46 @@ package com.diligrp.tax.storage.model.vo; | @@ -3,37 +3,46 @@ package com.diligrp.tax.storage.model.vo; | ||
| 3 | import lombok.Getter; | 3 | import lombok.Getter; |
| 4 | import lombok.Setter; | 4 | import lombok.Setter; |
| 5 | 5 | ||
| 6 | -import java.time.Instant; | ||
| 7 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 8 | import java.util.Map; | 7 | import java.util.Map; |
| 9 | 8 | ||
| 10 | @Getter | 9 | @Getter |
| 11 | @Setter | 10 | @Setter |
| 12 | public class TaxPipelineVO { | 11 | public class TaxPipelineVO { |
| 12 | + /** | ||
| 13 | + * id | ||
| 14 | + */ | ||
| 13 | private Long id; | 15 | private Long id; |
| 14 | - | ||
| 15 | - | 16 | + /** |
| 17 | + * 租户身份 | ||
| 18 | + */ | ||
| 16 | private Long tenantId; | 19 | private Long tenantId; |
| 17 | - | ||
| 18 | - | 20 | + /** |
| 21 | + * 系统代码 | ||
| 22 | + */ | ||
| 19 | private String systemCode; | 23 | private String systemCode; |
| 20 | - | ||
| 21 | - | 24 | + /** |
| 25 | + * 名字 | ||
| 26 | + */ | ||
| 22 | private String name; | 27 | private String name; |
| 23 | - | ||
| 24 | - | 28 | + /** |
| 29 | + * 编码 | ||
| 30 | + */ | ||
| 25 | private String code; | 31 | private String code; |
| 26 | - | ||
| 27 | - | 32 | + /** |
| 33 | + * 参数 | ||
| 34 | + */ | ||
| 28 | private Map<String, Object> params; | 35 | private Map<String, Object> params; |
| 29 | - | ||
| 30 | - | 36 | + /** |
| 37 | + * 状态 | ||
| 38 | + */ | ||
| 31 | private Integer state; | 39 | private Integer state; |
| 32 | - | ||
| 33 | - | 40 | + /** |
| 41 | + * 创造时间 | ||
| 42 | + */ | ||
| 34 | private LocalDateTime createdTime; | 43 | private LocalDateTime createdTime; |
| 35 | - | ||
| 36 | - | 44 | + /** |
| 45 | + * 修改时间 | ||
| 46 | + */ | ||
| 37 | private LocalDateTime modifiedTime; | 47 | private LocalDateTime modifiedTime; |
| 38 | - | ||
| 39 | } | 48 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxTenantVO.java
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineBusinessConfigRepository.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.repo; | ||
| 2 | - | ||
| 3 | -import com.diligrp.tax.storage.domain.TaxPipelineBusinessConfig; | ||
| 4 | -import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | -import org.springframework.stereotype.Repository; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | -* @author dili | ||
| 9 | -* @description 针对表【tax_pipeline_business_config(账套业务配置)】的数据库操作Mapper | ||
| 10 | -* @createDate 2025-11-13 14:58:05 | ||
| 11 | -* @Entity com.diligrp.tax.storage.domain.TaxPipelineBusinessConfig | ||
| 12 | -*/ | ||
| 13 | -@Repository | ||
| 14 | -public interface TaxPipelineBusinessConfigRepository extends BaseMapper<TaxPipelineBusinessConfig> { | ||
| 15 | - | ||
| 16 | -} | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineBusinessExtDataRepository.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.repo; | ||
| 2 | - | ||
| 3 | -import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 4 | -import com.diligrp.tax.storage.domain.TaxPipelineBusinessExtData; | ||
| 5 | -import org.springframework.stereotype.Repository; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * @author dili | ||
| 9 | - * @description 针对表【tax_pipeline_business_ext(账套业务配置)】的数据库操作Mapper | ||
| 10 | - * @createDate 2025-11-13 17:38:05 | ||
| 11 | - * @Entity com.diligrp.tax.storage.domain.TaxPipelineBusinessExt | ||
| 12 | - */ | ||
| 13 | -@Repository | ||
| 14 | -public interface TaxPipelineBusinessExtDataRepository extends BaseMapper<TaxPipelineBusinessExtData> { | ||
| 15 | - | ||
| 16 | -} | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineBusinessExtRepository.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.repo; | ||
| 2 | - | ||
| 3 | -import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 4 | -import com.diligrp.tax.storage.domain.TaxPipelineBusinessExt; | ||
| 5 | -import org.springframework.stereotype.Repository; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * @author dili | ||
| 9 | - * @description 针对表【tax_pipeline_business_ext(账套业务配置)】的数据库操作Mapper | ||
| 10 | - * @createDate 2025-11-13 17:38:05 | ||
| 11 | - * @Entity com.diligrp.tax.storage.domain.TaxPipelineBusinessExt | ||
| 12 | - */ | ||
| 13 | -@Repository | ||
| 14 | -public interface TaxPipelineBusinessExtRepository extends BaseMapper<TaxPipelineBusinessExt> { | ||
| 15 | - | ||
| 16 | -} | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - |
tax-storage/src/main/java/com/diligrp/tax/storage/service/TaxPipelineBusinessConfigService.java
| @@ -12,10 +12,15 @@ import com.diligrp.tax.central.type.DocumentValueWayType; | @@ -12,10 +12,15 @@ import com.diligrp.tax.central.type.DocumentValueWayType; | ||
| 12 | import com.diligrp.tax.central.type.TaxSystemType; | 12 | import com.diligrp.tax.central.type.TaxSystemType; |
| 13 | import com.diligrp.tax.central.utils.JsonUtils; | 13 | import com.diligrp.tax.central.utils.JsonUtils; |
| 14 | import com.diligrp.tax.storage.api.response.PipelineBusinessResponse; | 14 | import com.diligrp.tax.storage.api.response.PipelineBusinessResponse; |
| 15 | -import com.diligrp.tax.storage.domain.*; | ||
| 16 | -import com.diligrp.tax.storage.model.co.*; | ||
| 17 | -import com.diligrp.tax.storage.model.vo.*; | ||
| 18 | -import com.diligrp.tax.storage.repo.*; | 15 | +import com.diligrp.tax.storage.domain.TaxPipelineBusiness; |
| 16 | +import com.diligrp.tax.storage.domain.TaxPipelineBusinessKeyword; | ||
| 17 | +import com.diligrp.tax.storage.model.co.TaxPipelineBusinessCO; | ||
| 18 | +import com.diligrp.tax.storage.model.co.TaxPipelineBusinessKeywordCO; | ||
| 19 | +import com.diligrp.tax.storage.model.vo.TaxPipelineBusinessKeywordVO; | ||
| 20 | +import com.diligrp.tax.storage.model.vo.TaxPipelineBusinessVO; | ||
| 21 | +import com.diligrp.tax.storage.model.vo.TaxPipelineVO; | ||
| 22 | +import com.diligrp.tax.storage.repo.TaxPipelineBusinessKeywordRepository; | ||
| 23 | +import com.diligrp.tax.storage.repo.TaxPipelineBusinessRepository; | ||
| 19 | import jakarta.annotation.Resource; | 24 | import jakarta.annotation.Resource; |
| 20 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
| 21 | import org.springframework.transaction.annotation.Transactional; | 26 | import org.springframework.transaction.annotation.Transactional; |
| @@ -30,19 +35,8 @@ import java.util.Optional; | @@ -30,19 +35,8 @@ import java.util.Optional; | ||
| 30 | */ | 35 | */ |
| 31 | @Service | 36 | @Service |
| 32 | public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKeywordService { | 37 | public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKeywordService { |
| 33 | - | ||
| 34 | - @Resource | ||
| 35 | - private TaxPipelineBusinessConfigRepository taxPipelineBusinessConfigRepository; | ||
| 36 | - | ||
| 37 | @Resource | 38 | @Resource |
| 38 | private TaxPipelineBusinessRepository taxPipelineBusinessRepository; | 39 | private TaxPipelineBusinessRepository taxPipelineBusinessRepository; |
| 39 | - | ||
| 40 | - @Resource | ||
| 41 | - private TaxPipelineBusinessExtRepository taxPipelineBusinessExtRepository; | ||
| 42 | - | ||
| 43 | - @Resource | ||
| 44 | - private TaxPipelineBusinessExtDataRepository taxPipelineBusinessExtDataRepository; | ||
| 45 | - | ||
| 46 | @Resource | 40 | @Resource |
| 47 | private TaxPipelineBusinessKeywordRepository taxPipelineBusinessKeywordRepository; | 41 | private TaxPipelineBusinessKeywordRepository taxPipelineBusinessKeywordRepository; |
| 48 | @Resource | 42 | @Resource |
| @@ -90,9 +84,6 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | @@ -90,9 +84,6 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | ||
| 90 | @Transactional | 84 | @Transactional |
| 91 | public void deleteBusiness(Long id) { | 85 | public void deleteBusiness(Long id) { |
| 92 | taxPipelineBusinessRepository.deleteById(id); | 86 | taxPipelineBusinessRepository.deleteById(id); |
| 93 | - LambdaQueryWrapper<TaxPipelineBusinessConfig> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 94 | - queryWrapper.eq(TaxPipelineBusinessConfig::getTaxPipelineBusinessId, id); | ||
| 95 | - taxPipelineBusinessConfigRepository.delete(queryWrapper); | ||
| 96 | } | 87 | } |
| 97 | 88 | ||
| 98 | /** | 89 | /** |
| @@ -105,129 +96,7 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | @@ -105,129 +96,7 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | ||
| 105 | LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | 96 | LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); |
| 106 | queryWrapper.eq(TaxPipelineBusiness::getPipelineId, co.getPipelineId()); | 97 | queryWrapper.eq(TaxPipelineBusiness::getPipelineId, co.getPipelineId()); |
| 107 | Page<TaxPipelineBusiness> page = taxPipelineBusinessRepository.selectPage(Page.of(co.getPageNumber(), co.getPageSize()), queryWrapper); | 98 | Page<TaxPipelineBusiness> page = taxPipelineBusinessRepository.selectPage(Page.of(co.getPageNumber(), co.getPageSize()), queryWrapper); |
| 108 | - return page.convert(item -> { | ||
| 109 | - TaxPipelineBusinessVO pipelineBusiness = JsonUtils.convertValue(item, TaxPipelineBusinessVO.class); | ||
| 110 | - LambdaQueryWrapper<TaxPipelineBusinessConfig> wrapper = new LambdaQueryWrapper<>(); | ||
| 111 | - wrapper.eq(TaxPipelineBusinessConfig::getTaxPipelineBusinessId, item.getId()); | ||
| 112 | - List<TaxPipelineBusinessConfig> configs = taxPipelineBusinessConfigRepository.selectList(wrapper); | ||
| 113 | - pipelineBusiness.setConfigs(configs.stream().map(e -> JsonUtils.convertValue(e, TaxPipelineBusinessConfigVO.class)).toList()); | ||
| 114 | - return pipelineBusiness; | ||
| 115 | - }); | ||
| 116 | - } | ||
| 117 | - | ||
| 118 | - /** | ||
| 119 | - * 保存业务文档 | ||
| 120 | - * | ||
| 121 | - * @param co 公司 | ||
| 122 | - */ | ||
| 123 | - @Transactional | ||
| 124 | - public void saveBusinessDocument(TaxPipelineBusinessConfigCO co) { | ||
| 125 | - LambdaQueryWrapper<TaxPipelineBusinessConfig> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 126 | - queryWrapper.eq(TaxPipelineBusinessConfig::getTaxPipelineBusinessId, co.getTaxPipelineBusinessId()); | ||
| 127 | - taxPipelineBusinessConfigRepository.delete(queryWrapper); | ||
| 128 | - co.getDocumentTypes().forEach(documentType -> { | ||
| 129 | - DocumentType.validateDocumentType(documentType); | ||
| 130 | - var save = new TaxPipelineBusinessConfig(); | ||
| 131 | - save.setTaxPipelineBusinessId(co.getTaxPipelineBusinessId()); | ||
| 132 | - save.setDocumentType(documentType); | ||
| 133 | - taxPipelineBusinessConfigRepository.insert(save); | ||
| 134 | - }); | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - /** | ||
| 138 | - * 保存业务文档扩展 | ||
| 139 | - * | ||
| 140 | - * @param co 公司 | ||
| 141 | - */ | ||
| 142 | - @Transactional | ||
| 143 | - public void saveBusinessExt(TaxPipelineBusinessExtCO co) { | ||
| 144 | - LambdaQueryWrapper<TaxPipelineBusinessExt> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 145 | - queryWrapper.eq(TaxPipelineBusinessExt::getTaxPipelineBusinessId, co.getTaxPipelineBusinessId()); | ||
| 146 | - queryWrapper.eq(TaxPipelineBusinessExt::getExtCode, co.getExtCode()); | ||
| 147 | - TaxPipelineBusinessExt taxPipelineBusinessExt1 = taxPipelineBusinessExtRepository.selectOne(queryWrapper); | ||
| 148 | - Optional.ofNullable(taxPipelineBusinessExt1).ifPresent(taxPipelineBusinessExt -> { | ||
| 149 | - throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "业务扩展编码重复"); | ||
| 150 | - }); | ||
| 151 | - TaxPipelineBusinessExt taxPipelineBusinessExt = JsonUtils.convertValue(co, TaxPipelineBusinessExt.class); | ||
| 152 | - taxPipelineBusinessExtRepository.insert(taxPipelineBusinessExt); | ||
| 153 | - Optional.ofNullable(co.getExtDatas()).ifPresent(extDatas -> extDatas.forEach(e -> { | ||
| 154 | - var extData = new TaxPipelineBusinessExtData(); | ||
| 155 | - extData.setTaxPipelineBusinessExtId(taxPipelineBusinessExt.getId()); | ||
| 156 | - extData.setExtData(e); | ||
| 157 | - taxPipelineBusinessExtDataRepository.insert(extData); | ||
| 158 | - })); | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | - /** | ||
| 162 | - * 更新业务扩展 | ||
| 163 | - * | ||
| 164 | - * @param co 公司 | ||
| 165 | - */ | ||
| 166 | - @Transactional | ||
| 167 | - public void updateBusinessExt(TaxPipelineBusinessExtCO co) { | ||
| 168 | - LambdaQueryWrapper<TaxPipelineBusinessExt> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 169 | - queryWrapper.eq(TaxPipelineBusinessExt::getTaxPipelineBusinessId, co.getTaxPipelineBusinessId()); | ||
| 170 | - queryWrapper.eq(TaxPipelineBusinessExt::getId, co.getId()); | ||
| 171 | - TaxPipelineBusinessExt taxPipelineBusinessExt = taxPipelineBusinessExtRepository.selectOne(queryWrapper); | ||
| 172 | - Optional.ofNullable(taxPipelineBusinessExt).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "业务扩展信息不存在")); | ||
| 173 | - Optional.ofNullable(co.getExtName()).ifPresent(taxPipelineBusinessExt::setExtName); | ||
| 174 | - Optional.ofNullable(co.getExtCode()).ifPresent(taxPipelineBusinessExt::setExtCode); | ||
| 175 | - taxPipelineBusinessExtRepository.updateById(taxPipelineBusinessExt); | ||
| 176 | - } | ||
| 177 | - | ||
| 178 | - /** | ||
| 179 | - * 设置默认业务扩展数据 | ||
| 180 | - * | ||
| 181 | - * @param co 公司 | ||
| 182 | - */ | ||
| 183 | - @Transactional | ||
| 184 | - public void setDefaultBusinessExtData(TaxPipelineBusinessExtDefaultDataCO co) { | ||
| 185 | - LambdaQueryWrapper<TaxPipelineBusinessExt> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 186 | - queryWrapper.eq(TaxPipelineBusinessExt::getTaxPipelineBusinessId, co.getTaxPipelineBusinessId()); | ||
| 187 | - queryWrapper.eq(TaxPipelineBusinessExt::getId, co.getId()); | ||
| 188 | - TaxPipelineBusinessExt taxPipelineBusinessExt = taxPipelineBusinessExtRepository.selectOne(queryWrapper); | ||
| 189 | - Optional.ofNullable(taxPipelineBusinessExt).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "业务扩展信息不存在")); | ||
| 190 | - taxPipelineBusinessExt.setExtDefaultData(co.getExtDefaultData()); | ||
| 191 | - taxPipelineBusinessExtRepository.updateById(taxPipelineBusinessExt); | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - /** | ||
| 195 | - * 删除业务扩展 | ||
| 196 | - * | ||
| 197 | - * @param co 公司 | ||
| 198 | - */ | ||
| 199 | - @Transactional | ||
| 200 | - public void deleteBusinessExt(TaxPipelineBusinessExtCO co) { | ||
| 201 | - LambdaQueryWrapper<TaxPipelineBusinessExt> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 202 | - queryWrapper.eq(TaxPipelineBusinessExt::getTaxPipelineBusinessId, co.getTaxPipelineBusinessId()); | ||
| 203 | - queryWrapper.eq(TaxPipelineBusinessExt::getId, co.getId()); | ||
| 204 | - taxPipelineBusinessExtRepository.delete(queryWrapper); | ||
| 205 | - LambdaQueryWrapper<TaxPipelineBusinessExtData> extDataQueryWrapper = new LambdaQueryWrapper<>(); | ||
| 206 | - extDataQueryWrapper.eq(TaxPipelineBusinessExtData::getTaxPipelineBusinessExtId, co.getId()); | ||
| 207 | - taxPipelineBusinessExtDataRepository.delete(extDataQueryWrapper); | ||
| 208 | - } | ||
| 209 | - | ||
| 210 | - /** | ||
| 211 | - * 刷新业务扩展数据 | ||
| 212 | - * | ||
| 213 | - * @param co 公司 | ||
| 214 | - */ | ||
| 215 | - @Transactional | ||
| 216 | - public void refreshBusinessExtData(TaxPipelineBusinessExtCO co) { | ||
| 217 | - LambdaQueryWrapper<TaxPipelineBusinessExt> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 218 | - queryWrapper.eq(TaxPipelineBusinessExt::getTaxPipelineBusinessId, co.getTaxPipelineBusinessId()); | ||
| 219 | - queryWrapper.eq(TaxPipelineBusinessExt::getId, co.getId()); | ||
| 220 | - TaxPipelineBusinessExt taxPipelineBusinessExt = taxPipelineBusinessExtRepository.selectOne(queryWrapper); | ||
| 221 | - Optional.ofNullable(taxPipelineBusinessExt).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "业务扩展信息不存在")); | ||
| 222 | - LambdaQueryWrapper<TaxPipelineBusinessExtData> extDataQueryWrapper = new LambdaQueryWrapper<>(); | ||
| 223 | - extDataQueryWrapper.eq(TaxPipelineBusinessExtData::getTaxPipelineBusinessExtId, co.getId()); | ||
| 224 | - taxPipelineBusinessExtDataRepository.delete(extDataQueryWrapper); | ||
| 225 | - Optional.ofNullable(co.getExtDatas()).ifPresent(extDatas -> extDatas.forEach(e -> { | ||
| 226 | - var extData = new TaxPipelineBusinessExtData(); | ||
| 227 | - extData.setTaxPipelineBusinessExtId(co.getId()); | ||
| 228 | - extData.setExtData(e); | ||
| 229 | - taxPipelineBusinessExtDataRepository.insert(extData); | ||
| 230 | - })); | 99 | + return page.convert(item -> JsonUtils.convertValue(item, TaxPipelineBusinessVO.class)); |
| 231 | } | 100 | } |
| 232 | 101 | ||
| 233 | /** | 102 | /** |
| @@ -244,21 +113,11 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | @@ -244,21 +113,11 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | ||
| 244 | TaxPipelineBusiness taxPipelineBusiness = taxPipelineBusinessRepository.selectOne(queryWrapper); | 113 | TaxPipelineBusiness taxPipelineBusiness = taxPipelineBusinessRepository.selectOne(queryWrapper); |
| 245 | // 查询业务信息 | 114 | // 查询业务信息 |
| 246 | Optional.ofNullable(taxPipelineBusiness).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "业务信息不存在")); | 115 | Optional.ofNullable(taxPipelineBusiness).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "业务信息不存在")); |
| 247 | - LambdaQueryWrapper<TaxPipelineBusinessConfig> queryWrapper1 = new LambdaQueryWrapper<>(); | ||
| 248 | - queryWrapper1.eq(TaxPipelineBusinessConfig::getTaxPipelineBusinessId, taxPipelineBusiness.getId()); | ||
| 249 | - List<TaxPipelineBusinessConfig> taxPipelineBusinessConfigs = taxPipelineBusinessConfigRepository.selectList(queryWrapper1); | ||
| 250 | - // 获取业务配置单据信息 | ||
| 251 | - LambdaQueryWrapper<TaxPipelineBusinessExt> queryWrapper2 = new LambdaQueryWrapper<>(); | ||
| 252 | - queryWrapper2.eq(TaxPipelineBusinessExt::getTaxPipelineBusinessId, taxPipelineBusiness.getId()); | ||
| 253 | - List<TaxPipelineBusinessExt> taxPipelineBusinessExts = taxPipelineBusinessExtRepository.selectList(queryWrapper2); | ||
| 254 | - //获取业务扩展信息 | ||
| 255 | PipelineBusinessResponse pipelineBusinessResponse = new PipelineBusinessResponse(); | 116 | PipelineBusinessResponse pipelineBusinessResponse = new PipelineBusinessResponse(); |
| 256 | pipelineBusinessResponse.setId(taxPipelineBusiness.getId()); | 117 | pipelineBusinessResponse.setId(taxPipelineBusiness.getId()); |
| 257 | pipelineBusinessResponse.setPipelineId(taxPipelineBusiness.getPipelineId()); | 118 | pipelineBusinessResponse.setPipelineId(taxPipelineBusiness.getPipelineId()); |
| 258 | pipelineBusinessResponse.setBusinessCode(taxPipelineBusiness.getBusinessCode()); | 119 | pipelineBusinessResponse.setBusinessCode(taxPipelineBusiness.getBusinessCode()); |
| 259 | pipelineBusinessResponse.setBusinessName(taxPipelineBusiness.getBusinessName()); | 120 | pipelineBusinessResponse.setBusinessName(taxPipelineBusiness.getBusinessName()); |
| 260 | - pipelineBusinessResponse.setConfigs(taxPipelineBusinessConfigs.stream().map(TaxPipelineBusinessConfig::getDocumentType).toList()); | ||
| 261 | - pipelineBusinessResponse.setBusinessExt(taxPipelineBusinessExts.stream().map(item -> JsonUtils.convertValue(item, TaxPipelineBusinessExtVO.class)).toList()); | ||
| 262 | return pipelineBusinessResponse; | 121 | return pipelineBusinessResponse; |
| 263 | } | 122 | } |
| 264 | 123 | ||
| @@ -305,7 +164,7 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | @@ -305,7 +164,7 @@ public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKey | ||
| 305 | * @return {@link List }<{@link PipelineBusinessKeyword }> | 164 | * @return {@link List }<{@link PipelineBusinessKeyword }> |
| 306 | */ | 165 | */ |
| 307 | @Override | 166 | @Override |
| 308 | - public List<PipelineBusinessKeyword> queryByTenantAndPipelineAndBusiness(String group, String entity, String pipelineCode, String businessCode,String documentType) { | 167 | + public List<PipelineBusinessKeyword> queryByTenantAndPipelineAndBusiness(String group, String entity, String pipelineCode, String businessCode, String documentType) { |
| 309 | Long tenantId = taxTenantService.getTenantId(group, entity); | 168 | Long tenantId = taxTenantService.getTenantId(group, entity); |
| 310 | TaxPipelineVO byTenantIdAndCode = taxPipelineService.getByTenantIdAndCode(tenantId, pipelineCode); | 169 | TaxPipelineVO byTenantIdAndCode = taxPipelineService.getByTenantIdAndCode(tenantId, pipelineCode); |
| 311 | LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | 170 | LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); |