Commit bb1d2690bb76789b8a42865f29e05ba40a804a4d
1 parent
1d642251
refactor(core): 重构管道相关模型和服务接口
- 将 TenantPipeline 重命名为 PipelineDO - 将 TenantPipelineConfig 重命名为 PipelineDocFieldTypeDO - 将 PipelineBusinessKeyword 重命名为 PipelineBusinessKeywordDO - 将 TaxPipelineMappingError 重命名为 PipelineMappingErrorDO - 将 TaxPipelineVerify 重命名为 PipelineDocValidDO - 将 TaxPipelineVerifyReturn 重命名为 PipelineValidReturnDO - 将 TaxPipelineMappingCreate 重命名为 PipelineMappingCreateDO - 将 TenantTaxPipelineMapping 重命名为 PipelineMappingDO - 将 ITaxTenantService 重命名为 ITenantService - 将 ITaxPipelineBusinessKeywordService 重命名为 IPipelineBusinessKeywordService - 将 ITaxMappingErrorService 重命名为 IMappingErrorService - 将 ITaxPipelineVerifyService 重命名为 IPipelineDocValidService - 将 ITaxPipelineMappingService 重命名为 IPipelineMappingService - 更新所有引用上述类名的变量和方法参数 - 修改 AdoptMessageServiceImpl 中的业务逻辑以适配新的 DO 类型 - 修改 CustomerBuilder 中的数据处理逻辑以使用新命名的类 - 修改 MappingUtils 中的字段反射逻辑以适应新类结构 - 修改 CustomerTransformer 中的转换逻辑以使用 PipelineDO - 更新 KingDeeConnectionManager 中的连接获取方法参数类型 - 更新 MessageContext 中的 tenantPipeline 字段为 pipelineDO - 更新 Builder 接口中的 build 方法参数类型 - 更新 Transformer 接口中的 transform 方法参数类型 - 更新 InitializeProcessor 和 MappingProcessor 中的构建与转换调用 - 重命名存储层相关的实体类和仓库接口以符合新的命名规范
Showing
100 changed files
with
1048 additions
and
1213 deletions
Too many changes to show.
To preserve performance only 100 of 104 files are displayed.
tax-adopt/src/main/java/com/diligrp/tax/adopt/service/impl/AdoptMessageServiceImpl.java
| @@ -7,10 +7,10 @@ import com.diligrp.tax.adopt.model.ReceiveMessageCO; | @@ -7,10 +7,10 @@ import com.diligrp.tax.adopt.model.ReceiveMessageCO; | ||
| 7 | import com.diligrp.tax.adopt.service.AdoptMessageService; | 7 | import com.diligrp.tax.adopt.service.AdoptMessageService; |
| 8 | import com.diligrp.tax.adopt.util.ExcelUtils; | 8 | import com.diligrp.tax.adopt.util.ExcelUtils; |
| 9 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 9 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 10 | -import com.diligrp.tax.central.model.PipelineBusinessKeyword; | ||
| 11 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 12 | -import com.diligrp.tax.central.service.ITaxPipelineBusinessKeywordService; | ||
| 13 | -import com.diligrp.tax.central.service.ITaxTenantService; | 10 | +import com.diligrp.tax.central.model.PipelineBusinessKeywordDO; |
| 11 | +import com.diligrp.tax.central.model.PipelineDO; | ||
| 12 | +import com.diligrp.tax.central.service.IPipelineBusinessKeywordService; | ||
| 13 | +import com.diligrp.tax.central.service.ITenantService; | ||
| 14 | import com.diligrp.tax.central.type.TaxSystemType; | 14 | import com.diligrp.tax.central.type.TaxSystemType; |
| 15 | import com.diligrp.tax.central.utils.AdoptUtils; | 15 | import com.diligrp.tax.central.utils.AdoptUtils; |
| 16 | import com.diligrp.tax.central.utils.JsonUtils; | 16 | import com.diligrp.tax.central.utils.JsonUtils; |
| @@ -41,26 +41,26 @@ import static com.diligrp.tax.central.queue.TaxAutoPush.NORMAL_ROUTING; | @@ -41,26 +41,26 @@ import static com.diligrp.tax.central.queue.TaxAutoPush.NORMAL_ROUTING; | ||
| 41 | @Slf4j | 41 | @Slf4j |
| 42 | public class AdoptMessageServiceImpl implements AdoptMessageService { | 42 | public class AdoptMessageServiceImpl implements AdoptMessageService { |
| 43 | 43 | ||
| 44 | - private final ITaxPipelineBusinessKeywordService taxPipelineBusinessKeywordService; | 44 | + private final IPipelineBusinessKeywordService pipelineBusinessKeywordService; |
| 45 | private final RabbitTemplate rabbitTemplate; | 45 | private final RabbitTemplate rabbitTemplate; |
| 46 | - private final ITaxTenantService taxTenantService; | 46 | + private final ITenantService tenantService; |
| 47 | 47 | ||
| 48 | @Override | 48 | @Override |
| 49 | public void convertMessage(ReceiveMessageCO receiveMessageCO) { | 49 | public void convertMessage(ReceiveMessageCO receiveMessageCO) { |
| 50 | // 查询配置信息 | 50 | // 查询配置信息 |
| 51 | - List<PipelineBusinessKeyword> pipelineBusinessKeywords = taxPipelineBusinessKeywordService.queryByTenantAndPipelineAndBusiness(receiveMessageCO.getGroup(), | 51 | + List<PipelineBusinessKeywordDO> pipelineBusinessKeywordDOS = pipelineBusinessKeywordService.queryByTenantAndPipelineAndBusiness(receiveMessageCO.getGroup(), |
| 52 | receiveMessageCO.getEntity(), receiveMessageCO.getPipelineCode(), receiveMessageCO.getBusinessCode(), receiveMessageCO.getDocumentType()); | 52 | receiveMessageCO.getEntity(), receiveMessageCO.getPipelineCode(), receiveMessageCO.getBusinessCode(), receiveMessageCO.getDocumentType()); |
| 53 | - if (CollectionUtils.isEmpty(pipelineBusinessKeywords)) { | 53 | + if (CollectionUtils.isEmpty(pipelineBusinessKeywordDOS)) { |
| 54 | log.info("当前group{},entity {},账套编码{},业务代码{},文档类型{} 无配置信息", | 54 | log.info("当前group{},entity {},账套编码{},业务代码{},文档类型{} 无配置信息", |
| 55 | receiveMessageCO.getGroup(), receiveMessageCO.getEntity(), receiveMessageCO.getPipelineCode(), | 55 | receiveMessageCO.getGroup(), receiveMessageCO.getEntity(), receiveMessageCO.getPipelineCode(), |
| 56 | receiveMessageCO.getBusinessCode(), receiveMessageCO.getDocumentType()); | 56 | receiveMessageCO.getBusinessCode(), receiveMessageCO.getDocumentType()); |
| 57 | } else { | 57 | } else { |
| 58 | Map<String, Object> msgBody = receiveMessageCO.getMsgBody(); | 58 | Map<String, Object> msgBody = receiveMessageCO.getMsgBody(); |
| 59 | String json = JsonUtils.toJsonString(msgBody); | 59 | String json = JsonUtils.toJsonString(msgBody); |
| 60 | - Map<String, Object> map = AdoptUtils.handleAdopt(pipelineBusinessKeywords, json); | 60 | + Map<String, Object> map = AdoptUtils.handleAdopt(pipelineBusinessKeywordDOS, json); |
| 61 | receiveMessageCO.setMsgBody(map); | 61 | receiveMessageCO.setMsgBody(map); |
| 62 | } | 62 | } |
| 63 | - Optional<TenantPipeline> byTenantAndPipelineCode = taxTenantService.findByTenantAndPipelineCode(receiveMessageCO.getGroup(), receiveMessageCO.getEntity(), receiveMessageCO.getPipelineCode()); | 63 | + Optional<PipelineDO> byTenantAndPipelineCode = tenantService.findByTenantAndPipelineCode(receiveMessageCO.getGroup(), receiveMessageCO.getEntity(), receiveMessageCO.getPipelineCode()); |
| 64 | byTenantAndPipelineCode.ifPresent(tenantPipeline -> receiveMessageCO.setSystemType(tenantPipeline.getSystemType().code)); | 64 | byTenantAndPipelineCode.ifPresent(tenantPipeline -> receiveMessageCO.setSystemType(tenantPipeline.getSystemType().code)); |
| 65 | // 发送mq | 65 | // 发送mq |
| 66 | String messageJson = JsonUtils.toJsonString(receiveMessageCO); | 66 | String messageJson = JsonUtils.toJsonString(receiveMessageCO); |
| @@ -79,16 +79,16 @@ public class AdoptMessageServiceImpl implements AdoptMessageService { | @@ -79,16 +79,16 @@ public class AdoptMessageServiceImpl implements AdoptMessageService { | ||
| 79 | default -> throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "未支持的文件格式"); | 79 | default -> throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "未支持的文件格式"); |
| 80 | }; | 80 | }; |
| 81 | List<Map<String, Object>> list = ExcelUtils.processSheet(book); | 81 | List<Map<String, Object>> list = ExcelUtils.processSheet(book); |
| 82 | - Optional<TenantPipeline> pipelineOptional = taxTenantService.findByTenantAndPipelineCode(group, entity, pipelineCode); | ||
| 83 | - TenantPipeline pipeline = pipelineOptional.orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.NO_MATCHING_SET_OF_ACCOUNTS_FOUND, "未找到匹配账套")); | ||
| 84 | - list.forEach(map -> rabbitTemplate.convertAndSend(NORMAL_EXCHANGE, NORMAL_ROUTING, JsonUtils.toJsonString(getReceiveMessageCO(group, entity, pipelineCode, documentType, map, pipeline)))); | 82 | + Optional<PipelineDO> pipelineOptional = tenantService.findByTenantAndPipelineCode(group, entity, pipelineCode); |
| 83 | + PipelineDO pipelineDO = pipelineOptional.orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.NO_MATCHING_SET_OF_ACCOUNTS_FOUND, "未找到匹配账套")); | ||
| 84 | + list.forEach(map -> rabbitTemplate.convertAndSend(NORMAL_EXCHANGE, NORMAL_ROUTING, JsonUtils.toJsonString(getReceiveMessageCO(group, entity, pipelineCode, documentType, map, pipelineDO)))); | ||
| 85 | } catch (IOException e) { | 85 | } catch (IOException e) { |
| 86 | throw new TaxAgentServiceException(e.getMessage()); | 86 | throw new TaxAgentServiceException(e.getMessage()); |
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | - private static ReceiveMessageCO getReceiveMessageCO(String group, String entity, String pipelineCode, String documentType, Map<String, Object> map, TenantPipeline pipeline) { | ||
| 91 | - var msgBody = switch (pipeline.getSystemType()) { | 90 | + private static ReceiveMessageCO getReceiveMessageCO(String group, String entity, String pipelineCode, String documentType, Map<String, Object> map, PipelineDO pipelineDO) { |
| 91 | + var msgBody = switch (pipelineDO.getSystemType()) { | ||
| 92 | case KING_DEE -> kingdeeMap(map); | 92 | case KING_DEE -> kingdeeMap(map); |
| 93 | case YONG_YOU -> throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "未支持的系统形式"); | 93 | case YONG_YOU -> throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "未支持的系统形式"); |
| 94 | }; | 94 | }; |
| @@ -98,7 +98,7 @@ public class AdoptMessageServiceImpl implements AdoptMessageService { | @@ -98,7 +98,7 @@ public class AdoptMessageServiceImpl implements AdoptMessageService { | ||
| 98 | receiveMessageCO.setGroup(group); | 98 | receiveMessageCO.setGroup(group); |
| 99 | receiveMessageCO.setEntity(entity); | 99 | receiveMessageCO.setEntity(entity); |
| 100 | receiveMessageCO.setPipelineCode(pipelineCode); | 100 | receiveMessageCO.setPipelineCode(pipelineCode); |
| 101 | - receiveMessageCO.setSystemType(pipeline.getSystemType().code); | 101 | + receiveMessageCO.setSystemType(pipelineDO.getSystemType().code); |
| 102 | receiveMessageCO.setDocumentType(documentType); | 102 | receiveMessageCO.setDocumentType(documentType); |
| 103 | receiveMessageCO.setMsgBody(msgBody); | 103 | receiveMessageCO.setMsgBody(msgBody); |
| 104 | return receiveMessageCO; | 104 | return receiveMessageCO; |
tax-boot/src/main/java/com/diligrp/tax/boot/service/TaxReceiveService.java
| @@ -3,13 +3,13 @@ package com.diligrp.tax.boot.service; | @@ -3,13 +3,13 @@ package com.diligrp.tax.boot.service; | ||
| 3 | import com.diligrp.tax.central.context.TenantStorageContext; | 3 | import com.diligrp.tax.central.context.TenantStorageContext; |
| 4 | import com.diligrp.tax.central.domain.MessageContext; | 4 | import com.diligrp.tax.central.domain.MessageContext; |
| 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 6 | -import com.diligrp.tax.central.model.TaxPipelineMappingCreate; | ||
| 7 | -import com.diligrp.tax.central.model.TaxPipelineMappingError; | ||
| 8 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 9 | -import com.diligrp.tax.central.model.TenantTaxPipelineMapping; | ||
| 10 | -import com.diligrp.tax.central.service.ITaxMappingErrorService; | ||
| 11 | -import com.diligrp.tax.central.service.ITaxPipelineMappingService; | ||
| 12 | -import com.diligrp.tax.central.service.ITaxTenantService; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | +import com.diligrp.tax.central.model.PipelineMappingCreateDO; | ||
| 8 | +import com.diligrp.tax.central.model.PipelineMappingErrorDO; | ||
| 9 | +import com.diligrp.tax.central.model.PipelineMappingDO; | ||
| 10 | +import com.diligrp.tax.central.service.IMappingErrorService; | ||
| 11 | +import com.diligrp.tax.central.service.IPipelineMappingService; | ||
| 12 | +import com.diligrp.tax.central.service.ITenantService; | ||
| 13 | import com.diligrp.tax.central.type.DocumentType; | 13 | import com.diligrp.tax.central.type.DocumentType; |
| 14 | import com.diligrp.tax.central.type.MappingStateType; | 14 | import com.diligrp.tax.central.type.MappingStateType; |
| 15 | import com.diligrp.tax.central.type.SystemType; | 15 | import com.diligrp.tax.central.type.SystemType; |
| @@ -30,20 +30,20 @@ import java.util.Optional; | @@ -30,20 +30,20 @@ import java.util.Optional; | ||
| 30 | public class TaxReceiveService { | 30 | public class TaxReceiveService { |
| 31 | 31 | ||
| 32 | @Resource | 32 | @Resource |
| 33 | - private ITaxTenantService tenantTaxService; | 33 | + private ITenantService tenantService; |
| 34 | 34 | ||
| 35 | @Resource | 35 | @Resource |
| 36 | - private ITaxPipelineMappingService taxPipelineMappingService; | 36 | + private IPipelineMappingService taxPipelineMappingService; |
| 37 | 37 | ||
| 38 | @Resource | 38 | @Resource |
| 39 | - private ITaxMappingErrorService taxMappingErrorService; | 39 | + private IMappingErrorService taxMappingErrorService; |
| 40 | 40 | ||
| 41 | @Resource | 41 | @Resource |
| 42 | private TenantStorageContext tenantStorageContext; | 42 | private TenantStorageContext tenantStorageContext; |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | public void messagePreHandle(MessageContext ctx) { | 45 | public void messagePreHandle(MessageContext ctx) { |
| 46 | - Long tenantId = tenantTaxService.getTenantId(ctx.getGroup(), ctx.getEntity()); | 46 | + Long tenantId = tenantService.getTenantId(ctx.getGroup(), ctx.getEntity()); |
| 47 | ctx.setTenantId(tenantId); | 47 | ctx.setTenantId(tenantId); |
| 48 | DocumentType from = DocumentType.from(ctx.getDocumentType()); | 48 | DocumentType from = DocumentType.from(ctx.getDocumentType()); |
| 49 | SystemType system = SystemType.from(ctx.getSystemType()); | 49 | SystemType system = SystemType.from(ctx.getSystemType()); |
| @@ -52,28 +52,28 @@ public class TaxReceiveService { | @@ -52,28 +52,28 @@ public class TaxReceiveService { | ||
| 52 | ctx.setDocumentTypeEnum(from); | 52 | ctx.setDocumentTypeEnum(from); |
| 53 | ctx.setSystemTypeEnum(system); | 53 | ctx.setSystemTypeEnum(system); |
| 54 | // 获取租户管道 | 54 | // 获取租户管道 |
| 55 | - Optional<TenantPipeline> option = tenantStorageContext.getTenantPipeline(ctx.getTenantId(), system, ctx.getPipelineCode()); | ||
| 56 | - TenantPipeline pipeline = option.orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.NO_MATCHING_SET_OF_ACCOUNTS_FOUND)); | 55 | + Optional<PipelineDO> option = tenantStorageContext.getTenantPipeline(ctx.getTenantId(), system, ctx.getPipelineCode()); |
| 56 | + PipelineDO pipelineDO = option.orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.NO_MATCHING_SET_OF_ACCOUNTS_FOUND)); | ||
| 57 | //获取租户账套 | 57 | //获取租户账套 |
| 58 | - ctx.setTenantPipeline(pipeline); | 58 | + ctx.setPipelineDO(pipelineDO); |
| 59 | //获取租户id | 59 | //获取租户id |
| 60 | - ctx.setTenantId(tenantTaxService.getTenantId(ctx.getGroup(), ctx.getEntity())); | 60 | + ctx.setTenantId(tenantService.getTenantId(ctx.getGroup(), ctx.getEntity())); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | @Transactional | 63 | @Transactional |
| 64 | public void recordMapping(MessageContext messageContext) { | 64 | public void recordMapping(MessageContext messageContext) { |
| 65 | - Optional<TenantTaxPipelineMapping> dbOptions = taxPipelineMappingService.findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(messageContext.getTenantPipeline().getTenantId(), messageContext.getTenantPipeline().getId(), messageContext.getDocumentType(), messageContext.getSystemDataId(),messageContext.getPipelineDataId()); | 65 | + Optional<PipelineMappingDO> dbOptions = taxPipelineMappingService.findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(messageContext.getPipelineDO().getTenantId(), messageContext.getPipelineDO().getId(), messageContext.getDocumentType(), messageContext.getSystemDataId(),messageContext.getPipelineDataId()); |
| 66 | dbOptions.ifPresentOrElse( | 66 | dbOptions.ifPresentOrElse( |
| 67 | e -> { | 67 | e -> { |
| 68 | - TaxPipelineMappingCreate create = new TaxPipelineMappingCreate(); | 68 | + PipelineMappingCreateDO create = new PipelineMappingCreateDO(); |
| 69 | create.setId(e.getId()); | 69 | create.setId(e.getId()); |
| 70 | create.setTenantId(messageContext.getTenantId()); | 70 | create.setTenantId(messageContext.getTenantId()); |
| 71 | create.setOriginData(JsonUtils.toJsonString(messageContext.getMsgBody())); | 71 | create.setOriginData(JsonUtils.toJsonString(messageContext.getMsgBody())); |
| 72 | taxPipelineMappingService.update(create); | 72 | taxPipelineMappingService.update(create); |
| 73 | }, () -> { | 73 | }, () -> { |
| 74 | - TaxPipelineMappingCreate create = new TaxPipelineMappingCreate(); | 74 | + PipelineMappingCreateDO create = new PipelineMappingCreateDO(); |
| 75 | create.setTenantId(messageContext.getTenantId()); | 75 | create.setTenantId(messageContext.getTenantId()); |
| 76 | - create.setPipelineId(messageContext.getTenantPipeline().getId()); | 76 | + create.setPipelineId(messageContext.getPipelineDO().getId()); |
| 77 | create.setDocumentType(messageContext.getDocumentType()); | 77 | create.setDocumentType(messageContext.getDocumentType()); |
| 78 | create.setSystemDataId(messageContext.getSystemDataId()); | 78 | create.setSystemDataId(messageContext.getSystemDataId()); |
| 79 | create.setPipelineDataId(messageContext.getPipelineDataId()); | 79 | create.setPipelineDataId(messageContext.getPipelineDataId()); |
| @@ -86,7 +86,7 @@ public class TaxReceiveService { | @@ -86,7 +86,7 @@ public class TaxReceiveService { | ||
| 86 | 86 | ||
| 87 | @Transactional | 87 | @Transactional |
| 88 | public void recordMappingError(Exception e, MessageContext ctx) { | 88 | public void recordMappingError(Exception e, MessageContext ctx) { |
| 89 | - TaxPipelineMappingError error = new TaxPipelineMappingError(); | 89 | + PipelineMappingErrorDO error = new PipelineMappingErrorDO(); |
| 90 | error.setGroup(ctx.getGroup()); | 90 | error.setGroup(ctx.getGroup()); |
| 91 | error.setEntity(ctx.getEntity()); | 91 | error.setEntity(ctx.getEntity()); |
| 92 | error.setDocumentType(ctx.getDocumentType()); | 92 | error.setDocumentType(ctx.getDocumentType()); |
tax-central/src/main/java/com/diligrp/tax/central/context/TenantStorageContext.java
| 1 | package com.diligrp.tax.central.context; | 1 | package com.diligrp.tax.central.context; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 4 | -import com.diligrp.tax.central.service.ITaxTenantService; | 3 | +import com.diligrp.tax.central.model.PipelineDO; |
| 4 | +import com.diligrp.tax.central.service.ITenantService; | ||
| 5 | import com.diligrp.tax.central.type.SystemType; | 5 | import com.diligrp.tax.central.type.SystemType; |
| 6 | import jakarta.annotation.Resource; | 6 | import jakarta.annotation.Resource; |
| 7 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
| 8 | import org.springframework.boot.context.event.ApplicationReadyEvent; | 8 | import org.springframework.boot.context.event.ApplicationReadyEvent; |
| 9 | -import org.springframework.context.ApplicationEventPublisher; | ||
| 10 | import org.springframework.context.event.EventListener; | 9 | import org.springframework.context.event.EventListener; |
| 11 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| 12 | 11 | ||
| @@ -27,26 +26,26 @@ import java.util.stream.Collectors; | @@ -27,26 +26,26 @@ import java.util.stream.Collectors; | ||
| 27 | public class TenantStorageContext { | 26 | public class TenantStorageContext { |
| 28 | 27 | ||
| 29 | @Resource | 28 | @Resource |
| 30 | - private ITaxTenantService tenantTaxService; | 29 | + private ITenantService tenantService; |
| 31 | 30 | ||
| 32 | - private static final ConcurrentHashMap<Long, Map<SystemType, Map<String, TenantPipeline>>> TENANT_PIPELINE_MAP = new ConcurrentHashMap<>(); | 31 | + private static final ConcurrentHashMap<Long, Map<SystemType, Map<String, PipelineDO>>> TENANT_PIPELINE_MAP = new ConcurrentHashMap<>(); |
| 33 | 32 | ||
| 34 | - public Optional<TenantPipeline> getTenantPipeline(Long tenantId, SystemType systemType, String pipelineCode) { | 33 | + public Optional<PipelineDO> getTenantPipeline(Long tenantId, SystemType systemType, String pipelineCode) { |
| 35 | var tpMap = TENANT_PIPELINE_MAP.get(tenantId); | 34 | var tpMap = TENANT_PIPELINE_MAP.get(tenantId); |
| 36 | if (Objects.isNull(tpMap)) { | 35 | if (Objects.isNull(tpMap)) { |
| 37 | return Optional.empty(); | 36 | return Optional.empty(); |
| 38 | } | 37 | } |
| 39 | - Map<String, TenantPipeline> pipelineMap = tpMap.get(systemType); | 38 | + Map<String, PipelineDO> pipelineMap = tpMap.get(systemType); |
| 40 | if (Objects.isNull(pipelineMap)) { | 39 | if (Objects.isNull(pipelineMap)) { |
| 41 | return Optional.empty(); | 40 | return Optional.empty(); |
| 42 | } | 41 | } |
| 43 | - return Optional.ofNullable(pipelineMap.get(pipelineCode)).or(() -> tenantTaxService.findByTenantIdAndPipelineCode(tenantId, pipelineCode)); | 42 | + return Optional.ofNullable(pipelineMap.get(pipelineCode)).or(() -> tenantService.findByTenantIdAndPipelineCode(tenantId, pipelineCode)); |
| 44 | } | 43 | } |
| 45 | 44 | ||
| 46 | public void loadTenantPipeline() { | 45 | public void loadTenantPipeline() { |
| 47 | - List<TenantPipeline> taxPipelineVOS = tenantTaxService.listAllEnablePipeline(); | ||
| 48 | - Optional.ofNullable(taxPipelineVOS).ifPresent(pipelines -> { | ||
| 49 | - var tenantPipelineMap = pipelines.stream().collect(Collectors.groupingBy(TenantPipeline::getTenantId, Collectors.groupingBy(TenantPipeline::getSystemType, Collectors.toMap(TenantPipeline::getCode, e -> e)))); | 46 | + List<PipelineDO> taxPipelineDOVOS = tenantService.listAllEnablePipeline(); |
| 47 | + Optional.ofNullable(taxPipelineDOVOS).ifPresent(pipelines -> { | ||
| 48 | + var tenantPipelineMap = pipelines.stream().collect(Collectors.groupingBy(PipelineDO::getTenantId, Collectors.groupingBy(PipelineDO::getSystemType, Collectors.toMap(PipelineDO::getCode, e -> e)))); | ||
| 50 | TENANT_PIPELINE_MAP.clear(); | 49 | TENANT_PIPELINE_MAP.clear(); |
| 51 | TENANT_PIPELINE_MAP.putAll(tenantPipelineMap); | 50 | TENANT_PIPELINE_MAP.putAll(tenantPipelineMap); |
| 52 | }); | 51 | }); |
tax-central/src/main/java/com/diligrp/tax/central/domain/MessageContext.java
| 1 | package com.diligrp.tax.central.domain; | 1 | package com.diligrp.tax.central.domain; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TenantPipeline; | 3 | +import com.diligrp.tax.central.model.PipelineDO; |
| 4 | import com.diligrp.tax.central.type.DocumentType; | 4 | import com.diligrp.tax.central.type.DocumentType; |
| 5 | import com.diligrp.tax.central.type.SystemType; | 5 | import com.diligrp.tax.central.type.SystemType; |
| 6 | import lombok.Getter; | 6 | import lombok.Getter; |
| @@ -23,7 +23,7 @@ public class MessageContext { | @@ -23,7 +23,7 @@ public class MessageContext { | ||
| 23 | /** | 23 | /** |
| 24 | * 租户管道 | 24 | * 租户管道 |
| 25 | */ | 25 | */ |
| 26 | - private TenantPipeline tenantPipeline; | 26 | + private PipelineDO pipelineDO; |
| 27 | /** | 27 | /** |
| 28 | * 分组 | 28 | * 分组 |
| 29 | */ | 29 | */ |
tax-central/src/main/java/com/diligrp/tax/central/manager/AbstractConnectionManager.java
| 1 | package com.diligrp.tax.central.manager; | 1 | package com.diligrp.tax.central.manager; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TenantPipeline; | 3 | +import com.diligrp.tax.central.model.PipelineDO; |
| 4 | import com.diligrp.tax.central.type.SystemType; | 4 | import com.diligrp.tax.central.type.SystemType; |
| 5 | 5 | ||
| 6 | public abstract class AbstractConnectionManager<T> { | 6 | public abstract class AbstractConnectionManager<T> { |
| 7 | 7 | ||
| 8 | public abstract SystemType markSystemType(); | 8 | public abstract SystemType markSystemType(); |
| 9 | 9 | ||
| 10 | - public abstract T getConnection(TenantPipeline tenantPipeline); | 10 | + public abstract T getConnection(PipelineDO pipelineDO); |
| 11 | } | 11 | } |
tax-central/src/main/java/com/diligrp/tax/central/manager/impl/KingDeeConnectionManager.java
| 1 | package com.diligrp.tax.central.manager.impl; | 1 | package com.diligrp.tax.central.manager.impl; |
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.manager.AbstractConnectionManager; | 3 | import com.diligrp.tax.central.manager.AbstractConnectionManager; |
| 4 | -import com.diligrp.tax.central.model.TenantPipeline; | 4 | +import com.diligrp.tax.central.model.PipelineDO; |
| 5 | import com.diligrp.tax.central.type.SystemType; | 5 | import com.diligrp.tax.central.type.SystemType; |
| 6 | import com.diligrp.tax.central.utils.JsonUtils; | 6 | import com.diligrp.tax.central.utils.JsonUtils; |
| 7 | import com.kingdee.bos.webapi.entity.IdentifyInfo; | 7 | import com.kingdee.bos.webapi.entity.IdentifyInfo; |
| @@ -20,7 +20,7 @@ public class KingDeeConnectionManager extends AbstractConnectionManager<Identify | @@ -20,7 +20,7 @@ public class KingDeeConnectionManager extends AbstractConnectionManager<Identify | ||
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | @Override | 22 | @Override |
| 23 | - public IdentifyInfo getConnection(TenantPipeline tenantPipeline) { | ||
| 24 | - return JsonUtils.convertValue(tenantPipeline.getParams(), IdentifyInfo.class); | 23 | + public IdentifyInfo getConnection(PipelineDO pipelineDO) { |
| 24 | + return JsonUtils.convertValue(pipelineDO.getParams(), IdentifyInfo.class); | ||
| 25 | } | 25 | } |
| 26 | } | 26 | } |
tax-central/src/main/java/com/diligrp/tax/central/manager/impl/YongYouConnectionManager.java
| @@ -2,10 +2,9 @@ package com.diligrp.tax.central.manager.impl; | @@ -2,10 +2,9 @@ package com.diligrp.tax.central.manager.impl; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.connect.YongYouConnections; | 3 | import com.diligrp.tax.central.connect.YongYouConnections; |
| 4 | import com.diligrp.tax.central.manager.AbstractConnectionManager; | 4 | import com.diligrp.tax.central.manager.AbstractConnectionManager; |
| 5 | -import com.diligrp.tax.central.model.TenantPipeline; | 5 | +import com.diligrp.tax.central.model.PipelineDO; |
| 6 | import com.diligrp.tax.central.type.SystemType; | 6 | import com.diligrp.tax.central.type.SystemType; |
| 7 | import com.diligrp.tax.central.utils.JsonUtils; | 7 | import com.diligrp.tax.central.utils.JsonUtils; |
| 8 | -import com.kingdee.bos.webapi.entity.IdentifyInfo; | ||
| 9 | import org.springframework.stereotype.Component; | 8 | import org.springframework.stereotype.Component; |
| 10 | 9 | ||
| 11 | /** | 10 | /** |
| @@ -21,7 +20,7 @@ public class YongYouConnectionManager extends AbstractConnectionManager<YongYouC | @@ -21,7 +20,7 @@ public class YongYouConnectionManager extends AbstractConnectionManager<YongYouC | ||
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | @Override | 22 | @Override |
| 24 | - public YongYouConnections getConnection(TenantPipeline tenantPipeline) { | ||
| 25 | - return JsonUtils.convertValue(tenantPipeline.getParams(), YongYouConnections.class); | 23 | + public YongYouConnections getConnection(PipelineDO pipelineDO) { |
| 24 | + return JsonUtils.convertValue(pipelineDO.getParams(), YongYouConnections.class); | ||
| 26 | } | 25 | } |
| 27 | } | 26 | } |
tax-central/src/main/java/com/diligrp/tax/central/model/DynamicValue.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/DynamicValueDO.java
tax-central/src/main/java/com/diligrp/tax/central/model/Option.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/OptionDO.java
| @@ -14,7 +14,7 @@ import lombok.Setter; | @@ -14,7 +14,7 @@ import lombok.Setter; | ||
| 14 | @Setter | 14 | @Setter |
| 15 | @AllArgsConstructor | 15 | @AllArgsConstructor |
| 16 | @NoArgsConstructor | 16 | @NoArgsConstructor |
| 17 | -public class Option { | 17 | +public class OptionDO { |
| 18 | private String label; | 18 | private String label; |
| 19 | private String value; | 19 | private String value; |
| 20 | 20 |
tax-central/src/main/java/com/diligrp/tax/central/model/PipelineBusinessKeyword.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineBusinessKeywordDO.java
tax-central/src/main/java/com/diligrp/tax/central/model/TenantPipeline.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineDO.java
| @@ -13,7 +13,7 @@ import java.util.Map; | @@ -13,7 +13,7 @@ import java.util.Map; | ||
| 13 | */ | 13 | */ |
| 14 | @Setter | 14 | @Setter |
| 15 | @Getter | 15 | @Getter |
| 16 | -public class TenantPipeline { | 16 | +public class PipelineDO { |
| 17 | private Long id; | 17 | private Long id; |
| 18 | private Long tenantId; | 18 | private Long tenantId; |
| 19 | private SystemType systemType; | 19 | private SystemType systemType; |
tax-central/src/main/java/com/diligrp/tax/central/model/TenantPipelineConfig.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineDocFieldTypeDO.java
| @@ -13,7 +13,7 @@ import java.util.Map; | @@ -13,7 +13,7 @@ import java.util.Map; | ||
| 13 | */ | 13 | */ |
| 14 | @Getter | 14 | @Getter |
| 15 | @Setter | 15 | @Setter |
| 16 | -public class TenantPipelineConfig { | 16 | +public class PipelineDocFieldTypeDO { |
| 17 | /** | 17 | /** |
| 18 | * id | 18 | * id |
| 19 | */ | 19 | */ |
| @@ -48,5 +48,5 @@ public class TenantPipelineConfig { | @@ -48,5 +48,5 @@ public class TenantPipelineConfig { | ||
| 48 | /** | 48 | /** |
| 49 | * 远程参数 | 49 | * 远程参数 |
| 50 | */ | 50 | */ |
| 51 | - private RemoteParam remoteParam; | 51 | + private PipelineDocFieldTypeRemoteParamDO pipelineDocFieldTypeRemoteParamDO; |
| 52 | } | 52 | } |
tax-central/src/main/java/com/diligrp/tax/central/model/RemoteParam.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineDocFieldTypeRemoteParamDO.java
tax-central/src/main/java/com/diligrp/tax/central/model/TaxPipelineVerify.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineDocValidDO.java
tax-central/src/main/java/com/diligrp/tax/central/model/TaxPipelineMappingCreate.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineMappingCreateDO.java
tax-central/src/main/java/com/diligrp/tax/central/model/TenantTaxPipelineMapping.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineMappingDO.java
tax-central/src/main/java/com/diligrp/tax/central/model/TaxPipelineMappingError.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineMappingErrorDO.java
| @@ -5,8 +5,6 @@ import jakarta.validation.constraints.NotNull; | @@ -5,8 +5,6 @@ import jakarta.validation.constraints.NotNull; | ||
| 5 | import lombok.Getter; | 5 | import lombok.Getter; |
| 6 | import lombok.Setter; | 6 | import lombok.Setter; |
| 7 | 7 | ||
| 8 | -import java.time.LocalDateTime; | ||
| 9 | - | ||
| 10 | /** | 8 | /** |
| 11 | * @Author: zhangmeiyang | 9 | * @Author: zhangmeiyang |
| 12 | * @CreateTime: 2025-11-10 14:30 | 10 | * @CreateTime: 2025-11-10 14:30 |
| @@ -14,7 +12,7 @@ import java.time.LocalDateTime; | @@ -14,7 +12,7 @@ import java.time.LocalDateTime; | ||
| 14 | */ | 12 | */ |
| 15 | @Getter | 13 | @Getter |
| 16 | @Setter | 14 | @Setter |
| 17 | -public class TaxPipelineMappingError { | 15 | +public class PipelineMappingErrorDO { |
| 18 | /** | 16 | /** |
| 19 | * id | 17 | * id |
| 20 | */ | 18 | */ |
tax-central/src/main/java/com/diligrp/tax/central/model/TaxPipelineVerifyReturn.java renamed to tax-central/src/main/java/com/diligrp/tax/central/model/PipelineValidReturnDO.java
tax-central/src/main/java/com/diligrp/tax/central/service/ITaxMappingErrorService.java renamed to tax-central/src/main/java/com/diligrp/tax/central/service/IMappingErrorService.java
| 1 | package com.diligrp.tax.central.service; | 1 | package com.diligrp.tax.central.service; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TaxPipelineMappingError; | 3 | +import com.diligrp.tax.central.model.PipelineMappingErrorDO; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | * @Author: zhangmeiyang | 6 | * @Author: zhangmeiyang |
| 7 | * @CreateTime: 2025-11-10 14:29 | 7 | * @CreateTime: 2025-11-10 14:29 |
| 8 | * @Version: todo | 8 | * @Version: todo |
| 9 | */ | 9 | */ |
| 10 | -public interface ITaxMappingErrorService { | 10 | +public interface IMappingErrorService { |
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 插入 | 13 | * 插入 |
| 14 | * | 14 | * |
| 15 | * @param error 错误 | 15 | * @param error 错误 |
| 16 | */ | 16 | */ |
| 17 | - void insert(TaxPipelineMappingError error); | 17 | + void insert(PipelineMappingErrorDO error); |
| 18 | } | 18 | } |
tax-central/src/main/java/com/diligrp/tax/central/service/ITaxPipelineBusinessKeywordService.java renamed to tax-central/src/main/java/com/diligrp/tax/central/service/IPipelineBusinessKeywordService.java
| 1 | package com.diligrp.tax.central.service; | 1 | package com.diligrp.tax.central.service; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.PipelineBusinessKeyword; | 3 | +import com.diligrp.tax.central.model.PipelineBusinessKeywordDO; |
| 4 | 4 | ||
| 5 | import java.util.List; | 5 | import java.util.List; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| 8 | * @author lvqi | 8 | * @author lvqi |
| 9 | */ | 9 | */ |
| 10 | -public interface ITaxPipelineBusinessKeywordService { | 10 | +public interface IPipelineBusinessKeywordService { |
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 按租户、管道和业务查询 | 13 | * 按租户、管道和业务查询 |
| @@ -16,7 +16,7 @@ public interface ITaxPipelineBusinessKeywordService { | @@ -16,7 +16,7 @@ public interface ITaxPipelineBusinessKeywordService { | ||
| 16 | * @param entity 实体 | 16 | * @param entity 实体 |
| 17 | * @param pipelineCode 管道代码 | 17 | * @param pipelineCode 管道代码 |
| 18 | * @param businessCode 业务代码 | 18 | * @param businessCode 业务代码 |
| 19 | - * @return {@link List }<{@link PipelineBusinessKeyword }> | 19 | + * @return {@link List }<{@link PipelineBusinessKeywordDO }> |
| 20 | */ | 20 | */ |
| 21 | - List<PipelineBusinessKeyword> queryByTenantAndPipelineAndBusiness(String group, String entity, String pipelineCode, String businessCode,String documentType); | 21 | + List<PipelineBusinessKeywordDO> queryByTenantAndPipelineAndBusiness(String group, String entity, String pipelineCode, String businessCode, String documentType); |
| 22 | } | 22 | } |
tax-central/src/main/java/com/diligrp/tax/central/service/ITaxPipelineVerifyService.java renamed to tax-central/src/main/java/com/diligrp/tax/central/service/IPipelineDocValidService.java
| 1 | package com.diligrp.tax.central.service; | 1 | package com.diligrp.tax.central.service; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TaxPipelineVerify; | ||
| 4 | -import com.diligrp.tax.central.model.TaxPipelineVerifyReturn; | 3 | +import com.diligrp.tax.central.model.PipelineDocValidDO; |
| 4 | +import com.diligrp.tax.central.model.PipelineValidReturnDO; | ||
| 5 | 5 | ||
| 6 | import java.util.List; | 6 | import java.util.List; |
| 7 | 7 | ||
| 8 | -public interface ITaxPipelineVerifyService { | 8 | +public interface IPipelineDocValidService { |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 验证输入 | 11 | * 验证输入 |
| 12 | * | 12 | * |
| 13 | * @param pipelineId 管道 ID | 13 | * @param pipelineId 管道 ID |
| 14 | * @param documentType 文档类型 | 14 | * @param documentType 文档类型 |
| 15 | - * @return {@link List }<{@link TaxPipelineVerify }> | 15 | + * @return {@link List }<{@link PipelineDocValidDO }> |
| 16 | */ | 16 | */ |
| 17 | - List<TaxPipelineVerify> verifyInput(Long pipelineId, String documentType); | 17 | + List<PipelineDocValidDO> verifyInput(Long pipelineId, String documentType); |
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| 20 | * 验证输出 | 20 | * 验证输出 |
| 21 | * | 21 | * |
| 22 | * @param pipelineId 管道 ID | 22 | * @param pipelineId 管道 ID |
| 23 | * @param documentType 文档类型 | 23 | * @param documentType 文档类型 |
| 24 | - * @return {@link TaxPipelineVerifyReturn } | 24 | + * @return {@link PipelineValidReturnDO } |
| 25 | */ | 25 | */ |
| 26 | - TaxPipelineVerifyReturn verifyOutput(Long pipelineId, String documentType); | 26 | + PipelineValidReturnDO verifyOutput(Long pipelineId, String documentType); |
| 27 | } | 27 | } |
tax-central/src/main/java/com/diligrp/tax/central/service/ITaxPipelineMappingService.java renamed to tax-central/src/main/java/com/diligrp/tax/central/service/IPipelineMappingService.java
| 1 | package com.diligrp.tax.central.service; | 1 | package com.diligrp.tax.central.service; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TaxPipelineMappingCreate; | ||
| 4 | -import com.diligrp.tax.central.model.TenantTaxPipelineMapping; | 3 | +import com.diligrp.tax.central.model.PipelineMappingCreateDO; |
| 4 | +import com.diligrp.tax.central.model.PipelineMappingDO; | ||
| 5 | 5 | ||
| 6 | import java.util.Optional; | 6 | import java.util.Optional; |
| 7 | 7 | ||
| 8 | -public interface ITaxPipelineMappingService { | 8 | +public interface IPipelineMappingService { |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 按管道 ID 和文档类型以及系统数据 ID 查找 | 11 | * 按管道 ID 和文档类型以及系统数据 ID 查找 |
| @@ -15,9 +15,9 @@ public interface ITaxPipelineMappingService { | @@ -15,9 +15,9 @@ public interface ITaxPipelineMappingService { | ||
| 15 | * @param documentType 文档类型 | 15 | * @param documentType 文档类型 |
| 16 | * @param systemDataId 系统数据 ID | 16 | * @param systemDataId 系统数据 ID |
| 17 | * @param pipelineDataId | 17 | * @param pipelineDataId |
| 18 | - * @return {@link Optional }<{@link TenantTaxPipelineMapping }> | 18 | + * @return {@link Optional }<{@link PipelineMappingDO }> |
| 19 | */ | 19 | */ |
| 20 | - Optional<TenantTaxPipelineMapping> findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId, String pipelineDataId); | 20 | + Optional<PipelineMappingDO> findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId, String pipelineDataId); |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| @@ -27,21 +27,21 @@ public interface ITaxPipelineMappingService { | @@ -27,21 +27,21 @@ public interface ITaxPipelineMappingService { | ||
| 27 | * @param pipelineId 管道 ID | 27 | * @param pipelineId 管道 ID |
| 28 | * @param documentType 文档类型 | 28 | * @param documentType 文档类型 |
| 29 | * @param systemDataId 系统数据 ID | 29 | * @param systemDataId 系统数据 ID |
| 30 | - * @return {@link Optional }<{@link TenantTaxPipelineMapping }> | 30 | + * @return {@link Optional }<{@link PipelineMappingDO }> |
| 31 | */ | 31 | */ |
| 32 | - Optional<TenantTaxPipelineMapping> findByPipelineIdAndDocumentTypeAndSystemDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId); | 32 | + Optional<PipelineMappingDO> findByPipelineIdAndDocumentTypeAndSystemDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId); |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * 插入 | 35 | * 插入 |
| 36 | * | 36 | * |
| 37 | - * @param taxPipelineMappingCreate | 37 | + * @param pipelineMappingCreateDO |
| 38 | */ | 38 | */ |
| 39 | - void insert(TaxPipelineMappingCreate taxPipelineMappingCreate); | 39 | + void insert(PipelineMappingCreateDO pipelineMappingCreateDO); |
| 40 | 40 | ||
| 41 | /** | 41 | /** |
| 42 | * 更新 | 42 | * 更新 |
| 43 | * | 43 | * |
| 44 | - * @param taxPipelineMappingCreate 税务管道映射创建 | 44 | + * @param pipelineMappingCreateDO 税务管道映射创建 |
| 45 | */ | 45 | */ |
| 46 | - void update(TaxPipelineMappingCreate taxPipelineMappingCreate); | 46 | + void update(PipelineMappingCreateDO pipelineMappingCreateDO); |
| 47 | } | 47 | } |
tax-central/src/main/java/com/diligrp/tax/central/service/ITaxTenantService.java renamed to tax-central/src/main/java/com/diligrp/tax/central/service/ITenantService.java
| 1 | package com.diligrp.tax.central.service; | 1 | package com.diligrp.tax.central.service; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 4 | -import com.diligrp.tax.central.model.TenantPipelineConfig; | 3 | +import com.diligrp.tax.central.model.PipelineDO; |
| 4 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeDO; | ||
| 5 | 5 | ||
| 6 | import java.util.List; | 6 | import java.util.List; |
| 7 | import java.util.Optional; | 7 | import java.util.Optional; |
| @@ -11,7 +11,7 @@ import java.util.Optional; | @@ -11,7 +11,7 @@ import java.util.Optional; | ||
| 11 | * @CreateTime: 2025-11-06 14:20 | 11 | * @CreateTime: 2025-11-06 14:20 |
| 12 | * @Version: todo | 12 | * @Version: todo |
| 13 | */ | 13 | */ |
| 14 | -public interface ITaxTenantService { | 14 | +public interface ITenantService { |
| 15 | 15 | ||
| 16 | /** | 16 | /** |
| 17 | * 获取租户 ID | 17 | * 获取租户 ID |
| @@ -25,31 +25,31 @@ public interface ITaxTenantService { | @@ -25,31 +25,31 @@ public interface ITaxTenantService { | ||
| 25 | /** | 25 | /** |
| 26 | * 列出所有启用管道 | 26 | * 列出所有启用管道 |
| 27 | * | 27 | * |
| 28 | - * @return {@link List }<{@link TenantPipeline }> | 28 | + * @return {@link List }<{@link PipelineDO }> |
| 29 | */ | 29 | */ |
| 30 | - List<TenantPipeline> listAllEnablePipeline(); | 30 | + List<PipelineDO> listAllEnablePipeline(); |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * 列出所有启用管道 | 34 | * 列出所有启用管道 |
| 35 | * | 35 | * |
| 36 | - * @return {@link List }<{@link TenantPipeline }> | 36 | + * @return {@link List }<{@link PipelineDO }> |
| 37 | */ | 37 | */ |
| 38 | - Optional<TenantPipeline> findByTenantAndPipelineCode(String group,String entity,String pipelineCode); | 38 | + Optional<PipelineDO> findByTenantAndPipelineCode(String group, String entity, String pipelineCode); |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * 列出所有启用管道 | 41 | * 列出所有启用管道 |
| 42 | * | 42 | * |
| 43 | - * @return {@link List }<{@link TenantPipeline }> | 43 | + * @return {@link List }<{@link PipelineDO }> |
| 44 | */ | 44 | */ |
| 45 | - Optional<TenantPipeline> findByTenantIdAndPipelineCode(Long tenantId,String pipelineCode); | 45 | + Optional<PipelineDO> findByTenantIdAndPipelineCode(Long tenantId, String pipelineCode); |
| 46 | 46 | ||
| 47 | /** | 47 | /** |
| 48 | * 按管道 ID 列出 | 48 | * 按管道 ID 列出 |
| 49 | * | 49 | * |
| 50 | * @param pipelineId 管道 ID | 50 | * @param pipelineId 管道 ID |
| 51 | * @param documentType 文档类型 | 51 | * @param documentType 文档类型 |
| 52 | - * @return {@link List }<{@link TenantPipelineConfig }> | 52 | + * @return {@link List }<{@link PipelineDocFieldTypeDO }> |
| 53 | */ | 53 | */ |
| 54 | - List<TenantPipelineConfig> listByPipelineIdAndDocumentType(Long pipelineId, String documentType); | 54 | + List<PipelineDocFieldTypeDO> listByPipelineIdAndDocumentType(Long pipelineId, String documentType); |
| 55 | } | 55 | } |
tax-central/src/main/java/com/diligrp/tax/central/type/DocumentFieldType.java
| 1 | package com.diligrp.tax.central.type; | 1 | package com.diligrp.tax.central.type; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.PipelineBusinessKeyword; | 3 | +import com.diligrp.tax.central.model.PipelineBusinessKeywordDO; |
| 4 | import com.diligrp.tax.central.utils.JsonPathUtils; | 4 | import com.diligrp.tax.central.utils.JsonPathUtils; |
| 5 | import com.diligrp.tax.central.utils.JsonUtils; | 5 | import com.diligrp.tax.central.utils.JsonUtils; |
| 6 | import com.fasterxml.jackson.core.type.TypeReference; | 6 | import com.fasterxml.jackson.core.type.TypeReference; |
| @@ -10,13 +10,13 @@ import java.util.*; | @@ -10,13 +10,13 @@ import java.util.*; | ||
| 10 | public enum DocumentFieldType { | 10 | public enum DocumentFieldType { |
| 11 | OBJECT(1, "对象") { | 11 | OBJECT(1, "对象") { |
| 12 | @Override | 12 | @Override |
| 13 | - public void handleAdopt(Map<String, Object> res, PipelineBusinessKeyword keyword, String json) { | 13 | + public void handleAdopt(Map<String, Object> res, PipelineBusinessKeywordDO keyword, String json) { |
| 14 | res.put(keyword.getDocumentField(), JsonPathUtils.parse(json, keyword.getDocumentValueContent())); | 14 | res.put(keyword.getDocumentField(), JsonPathUtils.parse(json, keyword.getDocumentValueContent())); |
| 15 | } | 15 | } |
| 16 | }, | 16 | }, |
| 17 | OBJECT_ARRAY(2, "对象数组") { | 17 | OBJECT_ARRAY(2, "对象数组") { |
| 18 | @Override | 18 | @Override |
| 19 | - public void handleAdopt(Map<String, Object> res, PipelineBusinessKeyword keyword, String json) { | 19 | + public void handleAdopt(Map<String, Object> res, PipelineBusinessKeywordDO keyword, String json) { |
| 20 | List<Map<String, Object>> list = new ArrayList<>(); | 20 | List<Map<String, Object>> list = new ArrayList<>(); |
| 21 | Map<String, Object> data = JsonUtils.fromJsonString(json, new TypeReference<HashMap<String, Object>>() { | 21 | Map<String, Object> data = JsonUtils.fromJsonString(json, new TypeReference<HashMap<String, Object>>() { |
| 22 | }); | 22 | }); |
| @@ -30,7 +30,7 @@ public enum DocumentFieldType { | @@ -30,7 +30,7 @@ public enum DocumentFieldType { | ||
| 30 | }, | 30 | }, |
| 31 | OTHER(3, "其他") { | 31 | OTHER(3, "其他") { |
| 32 | @Override | 32 | @Override |
| 33 | - public void handleAdopt(Map<String, Object> res, PipelineBusinessKeyword keyword, String json) { | 33 | + public void handleAdopt(Map<String, Object> res, PipelineBusinessKeywordDO keyword, String json) { |
| 34 | } | 34 | } |
| 35 | }, | 35 | }, |
| 36 | ; | 36 | ; |
| @@ -51,5 +51,5 @@ public enum DocumentFieldType { | @@ -51,5 +51,5 @@ public enum DocumentFieldType { | ||
| 51 | throw new IllegalArgumentException("Invalid DocumentFieldType value: " + value); | 51 | throw new IllegalArgumentException("Invalid DocumentFieldType value: " + value); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | - public abstract void handleAdopt(Map<String, Object> res, PipelineBusinessKeyword keyword, String json); | 54 | + public abstract void handleAdopt(Map<String, Object> res, PipelineBusinessKeywordDO keyword, String json); |
| 55 | } | 55 | } |
tax-central/src/main/java/com/diligrp/tax/central/type/DocumentValueWayType.java
| 1 | package com.diligrp.tax.central.type; | 1 | package com.diligrp.tax.central.type; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.PipelineBusinessKeyword; | 3 | +import com.diligrp.tax.central.model.PipelineBusinessKeywordDO; |
| 4 | 4 | ||
| 5 | import java.util.Map; | 5 | import java.util.Map; |
| 6 | 6 | ||
| @@ -12,13 +12,13 @@ import java.util.Map; | @@ -12,13 +12,13 @@ import java.util.Map; | ||
| 12 | public enum DocumentValueWayType { | 12 | public enum DocumentValueWayType { |
| 13 | FIX(1, "固定") { | 13 | FIX(1, "固定") { |
| 14 | @Override | 14 | @Override |
| 15 | - public void handleAdopt(Map<String, Object> res, PipelineBusinessKeyword keyword, String json) { | 15 | + public void handleAdopt(Map<String, Object> res, PipelineBusinessKeywordDO keyword, String json) { |
| 16 | res.put(keyword.getDocumentField(), keyword.getDocumentValueContent()); | 16 | res.put(keyword.getDocumentField(), keyword.getDocumentValueContent()); |
| 17 | } | 17 | } |
| 18 | }, | 18 | }, |
| 19 | VARIABLE(2, "可变") { | 19 | VARIABLE(2, "可变") { |
| 20 | @Override | 20 | @Override |
| 21 | - public void handleAdopt(Map<String, Object> res, PipelineBusinessKeyword keyword, String json) { | 21 | + public void handleAdopt(Map<String, Object> res, PipelineBusinessKeywordDO keyword, String json) { |
| 22 | DocumentFieldType documentFieldTypeEnum = keyword.getDocumentFieldTypeEnum(); | 22 | DocumentFieldType documentFieldTypeEnum = keyword.getDocumentFieldTypeEnum(); |
| 23 | documentFieldTypeEnum.handleAdopt(res,keyword,json); | 23 | documentFieldTypeEnum.handleAdopt(res,keyword,json); |
| 24 | } | 24 | } |
| @@ -41,5 +41,5 @@ public enum DocumentValueWayType { | @@ -41,5 +41,5 @@ public enum DocumentValueWayType { | ||
| 41 | throw new IllegalArgumentException("Invalid DocumentValueWayType value: " + value); | 41 | throw new IllegalArgumentException("Invalid DocumentValueWayType value: " + value); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | - public abstract void handleAdopt(Map<String, Object> res, PipelineBusinessKeyword keyword, String json); | 44 | + public abstract void handleAdopt(Map<String, Object> res, PipelineBusinessKeywordDO keyword, String json); |
| 45 | } | 45 | } |
tax-central/src/main/java/com/diligrp/tax/central/utils/AdoptUtils.java
| 1 | package com.diligrp.tax.central.utils; | 1 | package com.diligrp.tax.central.utils; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.PipelineBusinessKeyword; | 3 | +import com.diligrp.tax.central.model.PipelineBusinessKeywordDO; |
| 4 | import com.diligrp.tax.central.type.DocumentValueWayType; | 4 | import com.diligrp.tax.central.type.DocumentValueWayType; |
| 5 | 5 | ||
| 6 | import java.util.*; | 6 | import java.util.*; |
| @@ -12,9 +12,9 @@ import java.util.*; | @@ -12,9 +12,9 @@ import java.util.*; | ||
| 12 | */ | 12 | */ |
| 13 | public class AdoptUtils { | 13 | public class AdoptUtils { |
| 14 | 14 | ||
| 15 | - public static Map<String, Object> handleAdopt(List<PipelineBusinessKeyword> pipelineBusinessKeywords, String json) { | 15 | + public static Map<String, Object> handleAdopt(List<PipelineBusinessKeywordDO> pipelineBusinessKeywordDOS, String json) { |
| 16 | Map<String, Object> res = new HashMap<>(); | 16 | Map<String, Object> res = new HashMap<>(); |
| 17 | - List<PipelineBusinessKeyword> keywords = Optional.ofNullable(pipelineBusinessKeywords).orElse(new ArrayList<>()); | 17 | + List<PipelineBusinessKeywordDO> keywords = Optional.ofNullable(pipelineBusinessKeywordDOS).orElse(new ArrayList<>()); |
| 18 | keywords.forEach(keyword -> { | 18 | keywords.forEach(keyword -> { |
| 19 | DocumentValueWayType documentValueWayTypeEnum = keyword.getDocumentValueWayTypeEnum(); | 19 | DocumentValueWayType documentValueWayTypeEnum = keyword.getDocumentValueWayTypeEnum(); |
| 20 | documentValueWayTypeEnum.handleAdopt(res, keyword, json); | 20 | documentValueWayTypeEnum.handleAdopt(res, keyword, json); |
tax-central/src/main/java/com/diligrp/tax/central/utils/MappingUtils.java
| @@ -8,8 +8,8 @@ import com.diligrp.tax.central.converter.anno.SubConverter; | @@ -8,8 +8,8 @@ import com.diligrp.tax.central.converter.anno.SubConverter; | ||
| 8 | import com.diligrp.tax.central.domain.BaseDocument; | 8 | import com.diligrp.tax.central.domain.BaseDocument; |
| 9 | import com.diligrp.tax.central.domain.BaseMapping; | 9 | import com.diligrp.tax.central.domain.BaseMapping; |
| 10 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 10 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 11 | -import com.diligrp.tax.central.model.RemoteParam; | ||
| 12 | -import com.diligrp.tax.central.model.TenantPipelineConfig; | 11 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeRemoteParamDO; |
| 12 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeDO; | ||
| 13 | import com.diligrp.tax.central.type.TaxSystemType; | 13 | import com.diligrp.tax.central.type.TaxSystemType; |
| 14 | import com.fasterxml.jackson.core.type.TypeReference; | 14 | import com.fasterxml.jackson.core.type.TypeReference; |
| 15 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
| @@ -17,7 +17,6 @@ import lombok.extern.slf4j.Slf4j; | @@ -17,7 +17,6 @@ import lombok.extern.slf4j.Slf4j; | ||
| 17 | import java.lang.reflect.Field; | 17 | import java.lang.reflect.Field; |
| 18 | import java.util.*; | 18 | import java.util.*; |
| 19 | import java.util.function.Function; | 19 | import java.util.function.Function; |
| 20 | -import java.util.stream.Stream; | ||
| 21 | 20 | ||
| 22 | /** | 21 | /** |
| 23 | * @Author: zhangmeiyang | 22 | * @Author: zhangmeiyang |
| @@ -80,11 +79,11 @@ public class MappingUtils { | @@ -80,11 +79,11 @@ public class MappingUtils { | ||
| 80 | return fields; | 79 | return fields; |
| 81 | } | 80 | } |
| 82 | 81 | ||
| 83 | - public static void reflectField(Object object, Field field, Map<String, TenantPipelineConfig> kvMap) { | 82 | + public static void reflectField(Object object, Field field, Map<String, PipelineDocFieldTypeDO> kvMap) { |
| 84 | if (kvMap.containsKey(field.getName())) { | 83 | if (kvMap.containsKey(field.getName())) { |
| 85 | field.setAccessible(true); | 84 | field.setAccessible(true); |
| 86 | try { | 85 | try { |
| 87 | - TenantPipelineConfig cfg = kvMap.get(field.getName()); | 86 | + PipelineDocFieldTypeDO cfg = kvMap.get(field.getName()); |
| 88 | switch (cfg.getSettingFieldType()) { | 87 | switch (cfg.getSettingFieldType()) { |
| 89 | case FIXED -> { | 88 | case FIXED -> { |
| 90 | var fixedValue = cfg.getFixedValue(); | 89 | var fixedValue = cfg.getFixedValue(); |
| @@ -98,15 +97,15 @@ public class MappingUtils { | @@ -98,15 +97,15 @@ public class MappingUtils { | ||
| 98 | } | 97 | } |
| 99 | } | 98 | } |
| 100 | case REMOTE -> { | 99 | case REMOTE -> { |
| 101 | - RemoteParam remoteParam = cfg.getRemoteParam(); | 100 | + PipelineDocFieldTypeRemoteParamDO pipelineDocFieldTypeRemoteParamDO = cfg.getPipelineDocFieldTypeRemoteParamDO(); |
| 102 | String value = (String) field.get(object); | 101 | String value = (String) field.get(object); |
| 103 | - String fixedParams = remoteParam.getFixedParams(); | ||
| 104 | - String remoteAddress = remoteParam.getRemoteAddress(); | 102 | + String fixedParams = pipelineDocFieldTypeRemoteParamDO.getFixedParams(); |
| 103 | + String remoteAddress = pipelineDocFieldTypeRemoteParamDO.getRemoteAddress(); | ||
| 105 | var params = JsonUtils.fromJsonString(fixedParams, new TypeReference<Map<String, Object>>() { | 104 | var params = JsonUtils.fromJsonString(fixedParams, new TypeReference<Map<String, Object>>() { |
| 106 | }); | 105 | }); |
| 107 | - params.put(remoteParam.getField(), value); | 106 | + params.put(pipelineDocFieldTypeRemoteParamDO.getField(), value); |
| 108 | var result = SingletonHttpClient.instance().postBody(remoteAddress, params); | 107 | var result = SingletonHttpClient.instance().postBody(remoteAddress, params); |
| 109 | - String remoteValue = JsonPathUtils.parseString(result, remoteParam.getDataPath()); | 108 | + String remoteValue = JsonPathUtils.parseString(result, pipelineDocFieldTypeRemoteParamDO.getDataPath()); |
| 110 | field.set(object, remoteValue); | 109 | field.set(object, remoteValue); |
| 111 | } | 110 | } |
| 112 | } | 111 | } |
tax-doc/src/main/java/com/diligrp/tax/doc/demarcate/Builder.java
| 1 | package com.diligrp.tax.doc.demarcate; | 1 | package com.diligrp.tax.doc.demarcate; |
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.domain.BaseDocument; | 3 | import com.diligrp.tax.central.domain.BaseDocument; |
| 4 | -import com.diligrp.tax.central.model.TenantPipeline; | 4 | +import com.diligrp.tax.central.model.PipelineDO; |
| 5 | import com.diligrp.tax.central.type.DocumentType; | 5 | import com.diligrp.tax.central.type.DocumentType; |
| 6 | 6 | ||
| 7 | import java.util.Map; | 7 | import java.util.Map; |
| @@ -24,9 +24,9 @@ public abstract class Builder<T extends BaseDocument> { | @@ -24,9 +24,9 @@ public abstract class Builder<T extends BaseDocument> { | ||
| 24 | * 建 | 24 | * 建 |
| 25 | * | 25 | * |
| 26 | * @param body 身体 | 26 | * @param body 身体 |
| 27 | - * @param pipeline | 27 | + * @param pipelineDO |
| 28 | * @param systemDataId | 28 | * @param systemDataId |
| 29 | * @return {@link T } | 29 | * @return {@link T } |
| 30 | */ | 30 | */ |
| 31 | - public abstract T build(Map<String, Object> body, TenantPipeline pipeline, String systemDataId); | 31 | + public abstract T build(Map<String, Object> body, PipelineDO pipelineDO, String systemDataId); |
| 32 | } | 32 | } |
tax-doc/src/main/java/com/diligrp/tax/doc/demarcate/kingdee/CustomerBuilder.java
| @@ -3,11 +3,11 @@ package com.diligrp.tax.doc.demarcate.kingdee; | @@ -3,11 +3,11 @@ package com.diligrp.tax.doc.demarcate.kingdee; | ||
| 3 | import com.diligrp.tax.central.domain.document.kingdee.basic.StandardCustomer; | 3 | import com.diligrp.tax.central.domain.document.kingdee.basic.StandardCustomer; |
| 4 | import com.diligrp.tax.central.domain.document.kingdee.basic.item.Contact; | 4 | import com.diligrp.tax.central.domain.document.kingdee.basic.item.Contact; |
| 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 6 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 7 | -import com.diligrp.tax.central.model.TenantPipelineConfig; | ||
| 8 | -import com.diligrp.tax.central.model.TenantTaxPipelineMapping; | ||
| 9 | -import com.diligrp.tax.central.service.ITaxPipelineMappingService; | ||
| 10 | -import com.diligrp.tax.central.service.ITaxTenantService; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeDO; | ||
| 8 | +import com.diligrp.tax.central.model.PipelineMappingDO; | ||
| 9 | +import com.diligrp.tax.central.service.IPipelineMappingService; | ||
| 10 | +import com.diligrp.tax.central.service.ITenantService; | ||
| 11 | import com.diligrp.tax.central.type.DocumentType; | 11 | import com.diligrp.tax.central.type.DocumentType; |
| 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; |
| @@ -33,10 +33,10 @@ import java.util.stream.Collectors; | @@ -33,10 +33,10 @@ import java.util.stream.Collectors; | ||
| 33 | public class CustomerBuilder extends Builder<StandardCustomer> { | 33 | public class CustomerBuilder extends Builder<StandardCustomer> { |
| 34 | 34 | ||
| 35 | @Resource | 35 | @Resource |
| 36 | - private ITaxPipelineMappingService taxPipelineMappingService; | 36 | + private IPipelineMappingService pipelineMappingService; |
| 37 | 37 | ||
| 38 | @Resource | 38 | @Resource |
| 39 | - private ITaxTenantService taxTenantService; | 39 | + private ITenantService tenantService; |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | @Override | 42 | @Override |
| @@ -45,14 +45,14 @@ public class CustomerBuilder extends Builder<StandardCustomer> { | @@ -45,14 +45,14 @@ public class CustomerBuilder extends Builder<StandardCustomer> { | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | @Override | 47 | @Override |
| 48 | - public StandardCustomer build(Map<String, Object> body, TenantPipeline pipeline, String systemDataId) { | 48 | + public StandardCustomer build(Map<String, Object> body, PipelineDO pipelineDO, String systemDataId) { |
| 49 | StandardCustomer customer = JsonUtils.convertValue(body, StandardCustomer.class); | 49 | StandardCustomer customer = JsonUtils.convertValue(body, StandardCustomer.class); |
| 50 | Optional.ofNullable(customer.getContacts()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请完善联系人信息")); | 50 | Optional.ofNullable(customer.getContacts()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请完善联系人信息")); |
| 51 | Optional.ofNullable(systemDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写系统数据ID")); | 51 | Optional.ofNullable(systemDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写系统数据ID")); |
| 52 | - List<TenantPipelineConfig> list = taxTenantService.listByPipelineIdAndDocumentType(pipeline.getId(), markDocument().value); | 52 | + List<PipelineDocFieldTypeDO> list = tenantService.listByPipelineIdAndDocumentType(pipelineDO.getId(), markDocument().value); |
| 53 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(customer, ts)); | 53 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(customer, ts)); |
| 54 | //查询数据库的客户信息 如果存在 赋值id | 54 | //查询数据库的客户信息 如果存在 赋值id |
| 55 | - Optional<TenantTaxPipelineMapping> dbOptions = taxPipelineMappingService.findByPipelineIdAndDocumentTypeAndSystemDataId(pipeline.getTenantId(), pipeline.getId(), markDocument().value, systemDataId); | 55 | + Optional<PipelineMappingDO> dbOptions = pipelineMappingService.findByPipelineIdAndDocumentTypeAndSystemDataId(pipelineDO.getTenantId(), pipelineDO.getId(), markDocument().value, systemDataId); |
| 56 | dbOptions.ifPresent(e -> { | 56 | dbOptions.ifPresent(e -> { |
| 57 | customer.setCustomerId(e.getPipelineDataId()); | 57 | customer.setCustomerId(e.getPipelineDataId()); |
| 58 | customer.setSystemDataId(e.getSystemDataId()); | 58 | customer.setSystemDataId(e.getSystemDataId()); |
| @@ -60,8 +60,8 @@ public class CustomerBuilder extends Builder<StandardCustomer> { | @@ -60,8 +60,8 @@ public class CustomerBuilder extends Builder<StandardCustomer> { | ||
| 60 | return customer; | 60 | return customer; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | - private void configureDefaultData(StandardCustomer customer, List<TenantPipelineConfig> list) { | ||
| 64 | - Map<String, TenantPipelineConfig> kvMap = list.stream().collect(Collectors.toMap(TenantPipelineConfig::getConfigKey, o -> o)); | 63 | + private void configureDefaultData(StandardCustomer customer, List<PipelineDocFieldTypeDO> list) { |
| 64 | + Map<String, PipelineDocFieldTypeDO> kvMap = list.stream().collect(Collectors.toMap(PipelineDocFieldTypeDO::getConfigKey, o -> o)); | ||
| 65 | List<Field> fields = MappingUtils.listFields(customer.getClass()); | 65 | List<Field> fields = MappingUtils.listFields(customer.getClass()); |
| 66 | fields.forEach(field -> MappingUtils.reflectField(customer, field, kvMap)); | 66 | fields.forEach(field -> MappingUtils.reflectField(customer, field, kvMap)); |
| 67 | List<Contact> items = customer.getContacts(); | 67 | List<Contact> items = customer.getContacts(); |
tax-doc/src/main/java/com/diligrp/tax/doc/demarcate/kingdee/ReceiptBuilder.java
| @@ -3,9 +3,9 @@ package com.diligrp.tax.doc.demarcate.kingdee; | @@ -3,9 +3,9 @@ package com.diligrp.tax.doc.demarcate.kingdee; | ||
| 3 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceiptBill; | 3 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceiptBill; |
| 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.item.ReceiptItem; | 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.item.ReceiptItem; |
| 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 6 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 7 | -import com.diligrp.tax.central.model.TenantPipelineConfig; | ||
| 8 | -import com.diligrp.tax.central.service.ITaxTenantService; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeDO; | ||
| 8 | +import com.diligrp.tax.central.service.ITenantService; | ||
| 9 | import com.diligrp.tax.central.type.DocumentType; | 9 | import com.diligrp.tax.central.type.DocumentType; |
| 10 | import com.diligrp.tax.central.type.TaxSystemType; | 10 | import com.diligrp.tax.central.type.TaxSystemType; |
| 11 | import com.diligrp.tax.central.utils.JsonUtils; | 11 | import com.diligrp.tax.central.utils.JsonUtils; |
| @@ -30,7 +30,7 @@ import java.util.stream.Collectors; | @@ -30,7 +30,7 @@ import java.util.stream.Collectors; | ||
| 30 | @Component | 30 | @Component |
| 31 | public class ReceiptBuilder extends Builder<ReceiptBill> { | 31 | public class ReceiptBuilder extends Builder<ReceiptBill> { |
| 32 | @Resource | 32 | @Resource |
| 33 | - private ITaxTenantService taxTenantService; | 33 | + private ITenantService tenantService; |
| 34 | 34 | ||
| 35 | @Override | 35 | @Override |
| 36 | public DocumentType markDocument() { | 36 | public DocumentType markDocument() { |
| @@ -38,17 +38,17 @@ public class ReceiptBuilder extends Builder<ReceiptBill> { | @@ -38,17 +38,17 @@ public class ReceiptBuilder extends Builder<ReceiptBill> { | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | @Override | 40 | @Override |
| 41 | - public ReceiptBill build(Map<String, Object> body, TenantPipeline pipeline, String systemDataId) { | 41 | + public ReceiptBill build(Map<String, Object> body, PipelineDO pipelineDO, String systemDataId) { |
| 42 | ReceiptBill bill = JsonUtils.convertValue(body, ReceiptBill.class); | 42 | ReceiptBill bill = JsonUtils.convertValue(body, ReceiptBill.class); |
| 43 | Optional.ofNullable(bill.getReceiptItems()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写收款项目")); | 43 | Optional.ofNullable(bill.getReceiptItems()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写收款项目")); |
| 44 | bill.setCreateTime(Optional.ofNullable(bill.getCreateTime()).orElse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); | 44 | bill.setCreateTime(Optional.ofNullable(bill.getCreateTime()).orElse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); |
| 45 | - List<TenantPipelineConfig> list = taxTenantService.listByPipelineIdAndDocumentType(pipeline.getId(), markDocument().value); | 45 | + List<PipelineDocFieldTypeDO> list = tenantService.listByPipelineIdAndDocumentType(pipelineDO.getId(), markDocument().value); |
| 46 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(bill, ts)); | 46 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(bill, ts)); |
| 47 | return bill; | 47 | return bill; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | - private void configureDefaultData(ReceiptBill bill, List<TenantPipelineConfig> list) { | ||
| 51 | - Map<String, TenantPipelineConfig> kvMap = list.stream().collect(Collectors.toMap(TenantPipelineConfig::getConfigKey, o -> o)); | 50 | + private void configureDefaultData(ReceiptBill bill, List<PipelineDocFieldTypeDO> list) { |
| 51 | + Map<String, PipelineDocFieldTypeDO> kvMap = list.stream().collect(Collectors.toMap(PipelineDocFieldTypeDO::getConfigKey, o -> o)); | ||
| 52 | List<Field> fields = MappingUtils.listFields(bill.getClass()); | 52 | List<Field> fields = MappingUtils.listFields(bill.getClass()); |
| 53 | fields.forEach(field -> MappingUtils.reflectField(bill, field, kvMap)); | 53 | fields.forEach(field -> MappingUtils.reflectField(bill, field, kvMap)); |
| 54 | List<ReceiptItem> items = bill.getReceiptItems(); | 54 | List<ReceiptItem> items = bill.getReceiptItems(); |
tax-doc/src/main/java/com/diligrp/tax/doc/demarcate/kingdee/ReceivableBuilder.java
| @@ -3,9 +3,9 @@ package com.diligrp.tax.doc.demarcate.kingdee; | @@ -3,9 +3,9 @@ package com.diligrp.tax.doc.demarcate.kingdee; | ||
| 3 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceivableBill; | 3 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceivableBill; |
| 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.item.ReceivableItem; | 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.item.ReceivableItem; |
| 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 6 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 7 | -import com.diligrp.tax.central.model.TenantPipelineConfig; | ||
| 8 | -import com.diligrp.tax.central.service.ITaxTenantService; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeDO; | ||
| 8 | +import com.diligrp.tax.central.service.ITenantService; | ||
| 9 | import com.diligrp.tax.central.type.DocumentType; | 9 | import com.diligrp.tax.central.type.DocumentType; |
| 10 | import com.diligrp.tax.central.type.TaxSystemType; | 10 | import com.diligrp.tax.central.type.TaxSystemType; |
| 11 | import com.diligrp.tax.central.utils.JsonUtils; | 11 | import com.diligrp.tax.central.utils.JsonUtils; |
| @@ -31,7 +31,7 @@ import java.util.stream.Collectors; | @@ -31,7 +31,7 @@ import java.util.stream.Collectors; | ||
| 31 | public class ReceivableBuilder extends Builder<ReceivableBill> { | 31 | public class ReceivableBuilder extends Builder<ReceivableBill> { |
| 32 | 32 | ||
| 33 | @Resource | 33 | @Resource |
| 34 | - private ITaxTenantService taxTenantService; | 34 | + private ITenantService tenantService; |
| 35 | 35 | ||
| 36 | @Override | 36 | @Override |
| 37 | public DocumentType markDocument() { | 37 | public DocumentType markDocument() { |
| @@ -39,17 +39,17 @@ public class ReceivableBuilder extends Builder<ReceivableBill> { | @@ -39,17 +39,17 @@ public class ReceivableBuilder extends Builder<ReceivableBill> { | ||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | @Override | 41 | @Override |
| 42 | - public ReceivableBill build(Map<String, Object> body, TenantPipeline pipeline, String systemDataId) { | 42 | + public ReceivableBill build(Map<String, Object> body, PipelineDO pipelineDO, String systemDataId) { |
| 43 | ReceivableBill bill = JsonUtils.convertValue(body, ReceivableBill.class); | 43 | ReceivableBill bill = JsonUtils.convertValue(body, ReceivableBill.class); |
| 44 | Optional.ofNullable(bill.getReceivableItems()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写收款项目")); | 44 | Optional.ofNullable(bill.getReceivableItems()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写收款项目")); |
| 45 | bill.setCreateTime(Optional.ofNullable(bill.getCreateTime()).orElse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); | 45 | bill.setCreateTime(Optional.ofNullable(bill.getCreateTime()).orElse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); |
| 46 | - List<TenantPipelineConfig> list = taxTenantService.listByPipelineIdAndDocumentType(pipeline.getId(), markDocument().value); | 46 | + List<PipelineDocFieldTypeDO> list = tenantService.listByPipelineIdAndDocumentType(pipelineDO.getId(), markDocument().value); |
| 47 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(bill, ts)); | 47 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(bill, ts)); |
| 48 | return bill; | 48 | return bill; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | - private void configureDefaultData(ReceivableBill bill, List<TenantPipelineConfig> list) { | ||
| 52 | - Map<String, TenantPipelineConfig> kvMap = list.stream().collect(Collectors.toMap(TenantPipelineConfig::getConfigKey, o -> o)); | 51 | + private void configureDefaultData(ReceivableBill bill, List<PipelineDocFieldTypeDO> list) { |
| 52 | + Map<String, PipelineDocFieldTypeDO> kvMap = list.stream().collect(Collectors.toMap(PipelineDocFieldTypeDO::getConfigKey, o -> o)); | ||
| 53 | List<Field> fields = MappingUtils.listFields(bill.getClass()); | 53 | List<Field> fields = MappingUtils.listFields(bill.getClass()); |
| 54 | fields.forEach(field -> MappingUtils.reflectField(bill, field, kvMap)); | 54 | fields.forEach(field -> MappingUtils.reflectField(bill, field, kvMap)); |
| 55 | List<ReceivableItem> items = bill.getReceivableItems(); | 55 | List<ReceivableItem> items = bill.getReceivableItems(); |
tax-doc/src/main/java/com/diligrp/tax/doc/demarcate/kingdee/RefundBuilder.java
| @@ -3,9 +3,9 @@ package com.diligrp.tax.doc.demarcate.kingdee; | @@ -3,9 +3,9 @@ package com.diligrp.tax.doc.demarcate.kingdee; | ||
| 3 | import com.diligrp.tax.central.domain.document.kingdee.bill.RefundBill; | 3 | import com.diligrp.tax.central.domain.document.kingdee.bill.RefundBill; |
| 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.item.RefundItem; | 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.item.RefundItem; |
| 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 6 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 7 | -import com.diligrp.tax.central.model.TenantPipelineConfig; | ||
| 8 | -import com.diligrp.tax.central.service.ITaxTenantService; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeDO; | ||
| 8 | +import com.diligrp.tax.central.service.ITenantService; | ||
| 9 | import com.diligrp.tax.central.type.DocumentType; | 9 | import com.diligrp.tax.central.type.DocumentType; |
| 10 | import com.diligrp.tax.central.type.TaxSystemType; | 10 | import com.diligrp.tax.central.type.TaxSystemType; |
| 11 | import com.diligrp.tax.central.utils.JsonUtils; | 11 | import com.diligrp.tax.central.utils.JsonUtils; |
| @@ -31,7 +31,7 @@ import java.util.stream.Collectors; | @@ -31,7 +31,7 @@ import java.util.stream.Collectors; | ||
| 31 | public class RefundBuilder extends Builder<RefundBill> { | 31 | public class RefundBuilder extends Builder<RefundBill> { |
| 32 | 32 | ||
| 33 | @Resource | 33 | @Resource |
| 34 | - private ITaxTenantService taxTenantService; | 34 | + private ITenantService tenantService; |
| 35 | 35 | ||
| 36 | @Override | 36 | @Override |
| 37 | public DocumentType markDocument() { | 37 | public DocumentType markDocument() { |
| @@ -39,17 +39,17 @@ public class RefundBuilder extends Builder<RefundBill> { | @@ -39,17 +39,17 @@ public class RefundBuilder extends Builder<RefundBill> { | ||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | @Override | 41 | @Override |
| 42 | - public RefundBill build(Map<String, Object> body, TenantPipeline pipeline, String systemDataId) { | 42 | + public RefundBill build(Map<String, Object> body, PipelineDO pipelineDO, String systemDataId) { |
| 43 | RefundBill bill = JsonUtils.convertValue(body, RefundBill.class); | 43 | RefundBill bill = JsonUtils.convertValue(body, RefundBill.class); |
| 44 | Optional.ofNullable(bill.getRefundItems()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写收款项目")); | 44 | Optional.ofNullable(bill.getRefundItems()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "请填写收款项目")); |
| 45 | bill.setCreateTime(Optional.ofNullable(bill.getCreateTime()).orElse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); | 45 | bill.setCreateTime(Optional.ofNullable(bill.getCreateTime()).orElse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); |
| 46 | - List<TenantPipelineConfig> list = taxTenantService.listByPipelineIdAndDocumentType(pipeline.getId(), markDocument().value); | 46 | + List<PipelineDocFieldTypeDO> list = tenantService.listByPipelineIdAndDocumentType(pipelineDO.getId(), markDocument().value); |
| 47 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(bill, ts)); | 47 | Optional.ofNullable(list).ifPresent(ts -> configureDefaultData(bill, ts)); |
| 48 | return bill; | 48 | return bill; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | - private void configureDefaultData(RefundBill bill, List<TenantPipelineConfig> list) { | ||
| 52 | - Map<String, TenantPipelineConfig> kvMap = list.stream().collect(Collectors.toMap(TenantPipelineConfig::getConfigKey, o -> o)); | 51 | + private void configureDefaultData(RefundBill bill, List<PipelineDocFieldTypeDO> list) { |
| 52 | + Map<String, PipelineDocFieldTypeDO> kvMap = list.stream().collect(Collectors.toMap(PipelineDocFieldTypeDO::getConfigKey, o -> o)); | ||
| 53 | List<Field> fields = MappingUtils.listFields(bill.getClass()); | 53 | List<Field> fields = MappingUtils.listFields(bill.getClass()); |
| 54 | fields.forEach(field -> MappingUtils.reflectField(bill, field, kvMap)); | 54 | fields.forEach(field -> MappingUtils.reflectField(bill, field, kvMap)); |
| 55 | List<RefundItem> items = bill.getRefundItems(); | 55 | List<RefundItem> items = bill.getRefundItems(); |
tax-doc/src/main/java/com/diligrp/tax/doc/process/kingdee/InitializeProcessor.java
| @@ -24,7 +24,7 @@ public class InitializeProcessor extends AbstractProcessor { | @@ -24,7 +24,7 @@ public class InitializeProcessor extends AbstractProcessor { | ||
| 24 | @Override | 24 | @Override |
| 25 | public MessageContext process(MessageContext messageContext) { | 25 | public MessageContext process(MessageContext messageContext) { |
| 26 | Builder<?> builder = DocumentContext.CONTEXT.get(messageContext.getDocumentTypeEnum()); | 26 | Builder<?> builder = DocumentContext.CONTEXT.get(messageContext.getDocumentTypeEnum()); |
| 27 | - BaseDocument build = builder.build(messageContext.getMsgBody(), messageContext.getTenantPipeline(), messageContext.getSystemDataId()); | 27 | + BaseDocument build = builder.build(messageContext.getMsgBody(), messageContext.getPipelineDO(), messageContext.getSystemDataId()); |
| 28 | messageContext.setDocumentObject(build); | 28 | messageContext.setDocumentObject(build); |
| 29 | return messageContext; | 29 | return messageContext; |
| 30 | } | 30 | } |
tax-map/src/main/java/com/diligrp/tax/mapping/demarcate/Transformer.java
| @@ -2,12 +2,13 @@ package com.diligrp.tax.mapping.demarcate; | @@ -2,12 +2,13 @@ package com.diligrp.tax.mapping.demarcate; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.domain.BaseDocument; | 3 | import com.diligrp.tax.central.domain.BaseDocument; |
| 4 | import com.diligrp.tax.central.domain.BaseMapping; | 4 | import com.diligrp.tax.central.domain.BaseMapping; |
| 5 | +import com.diligrp.tax.central.domain.mapping.kingdee.CustomerMapping; | ||
| 5 | import com.diligrp.tax.central.domain.mapping.kingdee.VerifyMarkInterface; | 6 | import com.diligrp.tax.central.domain.mapping.kingdee.VerifyMarkInterface; |
| 6 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 7 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 7 | -import com.diligrp.tax.central.model.TaxPipelineVerify; | ||
| 8 | -import com.diligrp.tax.central.model.TaxPipelineVerifyReturn; | ||
| 9 | -import com.diligrp.tax.central.model.TenantPipeline; | ||
| 10 | -import com.diligrp.tax.central.service.ITaxPipelineVerifyService; | 8 | +import com.diligrp.tax.central.model.PipelineDO; |
| 9 | +import com.diligrp.tax.central.model.PipelineDocValidDO; | ||
| 10 | +import com.diligrp.tax.central.model.PipelineValidReturnDO; | ||
| 11 | +import com.diligrp.tax.central.service.IPipelineDocValidService; | ||
| 11 | import com.diligrp.tax.central.type.DocumentType; | 12 | import com.diligrp.tax.central.type.DocumentType; |
| 12 | import com.diligrp.tax.central.type.TaxSystemType; | 13 | import com.diligrp.tax.central.type.TaxSystemType; |
| 13 | import com.diligrp.tax.central.utils.MappingUtils; | 14 | import com.diligrp.tax.central.utils.MappingUtils; |
| @@ -26,7 +27,7 @@ import java.util.*; | @@ -26,7 +27,7 @@ import java.util.*; | ||
| 26 | public abstract class Transformer<T extends BaseMapping> { | 27 | public abstract class Transformer<T extends BaseMapping> { |
| 27 | 28 | ||
| 28 | @Resource | 29 | @Resource |
| 29 | - protected ITaxPipelineVerifyService taxPipelineVerifyService; | 30 | + protected IPipelineDocValidService taxPipelineVerifyService; |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * 标记文档 | 33 | * 标记文档 |
| @@ -39,10 +40,10 @@ public abstract class Transformer<T extends BaseMapping> { | @@ -39,10 +40,10 @@ public abstract class Transformer<T extends BaseMapping> { | ||
| 39 | * 变换 | 40 | * 变换 |
| 40 | * | 41 | * |
| 41 | * @param document 公文 | 42 | * @param document 公文 |
| 42 | - * @param tenantPipeline | 43 | + * @param pipelineDO |
| 43 | * @return {@link T } | 44 | * @return {@link T } |
| 44 | */ | 45 | */ |
| 45 | - public abstract T transform(BaseDocument document, TenantPipeline tenantPipeline); | 46 | + public abstract T transform(BaseDocument document, PipelineDO pipelineDO); |
| 46 | 47 | ||
| 47 | 48 | ||
| 48 | /** | 49 | /** |
| @@ -52,8 +53,8 @@ public abstract class Transformer<T extends BaseMapping> { | @@ -52,8 +53,8 @@ public abstract class Transformer<T extends BaseMapping> { | ||
| 52 | * @return {@link List }<{@link String }> | 53 | * @return {@link List }<{@link String }> |
| 53 | */ | 54 | */ |
| 54 | protected List<String> getVerifyKeys(Long pipelineId) { | 55 | protected List<String> getVerifyKeys(Long pipelineId) { |
| 55 | - List<TaxPipelineVerify> taxPipelineVerifies = taxPipelineVerifyService.verifyInput(pipelineId, markDocument().value); | ||
| 56 | - return Optional.ofNullable(taxPipelineVerifies).orElse(List.of()).stream().map(TaxPipelineVerify::getConfigVerifyField).toList(); | 56 | + List<PipelineDocValidDO> taxPipelineVerifies = taxPipelineVerifyService.verifyInput(pipelineId, markDocument().value); |
| 57 | + return Optional.ofNullable(taxPipelineVerifies).orElse(List.of()).stream().map(PipelineDocValidDO::getConfigVerifyField).toList(); | ||
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | /** | 60 | /** |
| @@ -63,11 +64,11 @@ public abstract class Transformer<T extends BaseMapping> { | @@ -63,11 +64,11 @@ public abstract class Transformer<T extends BaseMapping> { | ||
| 63 | * @return {@link String } | 64 | * @return {@link String } |
| 64 | */ | 65 | */ |
| 65 | protected String getReturnKeys(Long pipelineId) { | 66 | protected String getReturnKeys(Long pipelineId) { |
| 66 | - TaxPipelineVerifyReturn taxPipelineVerifyReturn = taxPipelineVerifyService.verifyOutput(pipelineId, markDocument().value); | ||
| 67 | - if (Objects.isNull(taxPipelineVerifyReturn)) { | 67 | + PipelineValidReturnDO pipelineValidReturnDO = taxPipelineVerifyService.verifyOutput(pipelineId, markDocument().value); |
| 68 | + if (Objects.isNull(pipelineValidReturnDO)) { | ||
| 68 | return ""; | 69 | return ""; |
| 69 | } | 70 | } |
| 70 | - return taxPipelineVerifyReturn.getConfigReturnField(); | 71 | + return pipelineValidReturnDO.getConfigReturnField(); |
| 71 | } | 72 | } |
| 72 | 73 | ||
| 73 | 74 | ||
| @@ -117,4 +118,11 @@ public abstract class Transformer<T extends BaseMapping> { | @@ -117,4 +118,11 @@ public abstract class Transformer<T extends BaseMapping> { | ||
| 117 | log.info("verifyInfo is {},", String.join(" and ", concatVerify)); | 118 | log.info("verifyInfo is {},", String.join(" and ", concatVerify)); |
| 118 | return String.join(" and ", concatVerify); | 119 | return String.join(" and ", concatVerify); |
| 119 | } | 120 | } |
| 121 | + | ||
| 122 | + protected void setValidKeys(PipelineDO pipelineDO, BaseMapping mapping) { | ||
| 123 | + List<String> verifyKeys = getVerifyKeys(pipelineDO.getId()); | ||
| 124 | + String returnKeys = getReturnKeys(pipelineDO.getId()); | ||
| 125 | + Optional.ofNullable(verifyKeys).ifPresent(e -> mapping.setVerifyInformation(getVerifyString(verifyKeys, mapping))); | ||
| 126 | + Optional.ofNullable(returnKeys).ifPresent(mapping::setReturnKeys); | ||
| 127 | + } | ||
| 120 | } | 128 | } |
tax-map/src/main/java/com/diligrp/tax/mapping/demarcate/kingdee/CustomerTransformer.java
| 1 | package com.diligrp.tax.mapping.demarcate.kingdee; | 1 | package com.diligrp.tax.mapping.demarcate.kingdee; |
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.domain.BaseDocument; | 3 | import com.diligrp.tax.central.domain.BaseDocument; |
| 4 | -import com.diligrp.tax.central.domain.BaseMapping; | ||
| 5 | import com.diligrp.tax.central.domain.document.kingdee.basic.StandardCustomer; | 4 | import com.diligrp.tax.central.domain.document.kingdee.basic.StandardCustomer; |
| 6 | import com.diligrp.tax.central.domain.mapping.kingdee.CustomerMapping; | 5 | import com.diligrp.tax.central.domain.mapping.kingdee.CustomerMapping; |
| 7 | -import com.diligrp.tax.central.domain.mapping.kingdee.VerifyMarkInterface; | ||
| 8 | -import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 9 | -import com.diligrp.tax.central.model.TenantPipeline; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 10 | import com.diligrp.tax.central.type.DocumentType; | 7 | import com.diligrp.tax.central.type.DocumentType; |
| 11 | -import com.diligrp.tax.central.type.TaxSystemType; | ||
| 12 | import com.diligrp.tax.central.utils.MappingUtils; | 8 | import com.diligrp.tax.central.utils.MappingUtils; |
| 13 | import com.diligrp.tax.mapping.demarcate.Transformer; | 9 | import com.diligrp.tax.mapping.demarcate.Transformer; |
| 14 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
| 15 | import org.springframework.stereotype.Component; | 11 | import org.springframework.stereotype.Component; |
| 16 | 12 | ||
| 17 | -import java.lang.reflect.Field; | ||
| 18 | -import java.util.ArrayList; | ||
| 19 | -import java.util.HashSet; | ||
| 20 | import java.util.List; | 13 | import java.util.List; |
| 21 | import java.util.Optional; | 14 | import java.util.Optional; |
| 22 | 15 | ||
| @@ -35,13 +28,10 @@ public class CustomerTransformer extends Transformer<CustomerMapping> { | @@ -35,13 +28,10 @@ public class CustomerTransformer extends Transformer<CustomerMapping> { | ||
| 35 | } | 28 | } |
| 36 | 29 | ||
| 37 | @Override | 30 | @Override |
| 38 | - public CustomerMapping transform(BaseDocument document, TenantPipeline tenantPipeline) { | 31 | + public CustomerMapping transform(BaseDocument document, PipelineDO pipelineDO) { |
| 39 | StandardCustomer customer = (StandardCustomer) document; | 32 | StandardCustomer customer = (StandardCustomer) document; |
| 40 | CustomerMapping mapping = MappingUtils.convertValue(customer, CustomerMapping.class); | 33 | CustomerMapping mapping = MappingUtils.convertValue(customer, CustomerMapping.class); |
| 41 | - List<String> verifyKeys = getVerifyKeys(tenantPipeline.getId()); | ||
| 42 | - String returnKeys = getReturnKeys(tenantPipeline.getId()); | ||
| 43 | - Optional.ofNullable(verifyKeys).ifPresent(e -> mapping.setVerifyInformation(getVerifyString(verifyKeys, mapping))); | ||
| 44 | - Optional.ofNullable(returnKeys).ifPresent(mapping::setReturnKeys); | 34 | + setValidKeys(pipelineDO, mapping); |
| 45 | return mapping; | 35 | return mapping; |
| 46 | } | 36 | } |
| 47 | } | 37 | } |
tax-map/src/main/java/com/diligrp/tax/mapping/demarcate/kingdee/ReceiptTransformer.java
| @@ -3,7 +3,7 @@ package com.diligrp.tax.mapping.demarcate.kingdee; | @@ -3,7 +3,7 @@ package com.diligrp.tax.mapping.demarcate.kingdee; | ||
| 3 | import com.diligrp.tax.central.domain.BaseDocument; | 3 | import com.diligrp.tax.central.domain.BaseDocument; |
| 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceiptBill; | 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceiptBill; |
| 5 | import com.diligrp.tax.central.domain.mapping.kingdee.ReceiptMapping; | 5 | import com.diligrp.tax.central.domain.mapping.kingdee.ReceiptMapping; |
| 6 | -import com.diligrp.tax.central.model.TenantPipeline; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | import com.diligrp.tax.central.type.DocumentType; | 7 | import com.diligrp.tax.central.type.DocumentType; |
| 8 | import com.diligrp.tax.central.utils.MappingUtils; | 8 | import com.diligrp.tax.central.utils.MappingUtils; |
| 9 | import com.diligrp.tax.mapping.demarcate.Transformer; | 9 | import com.diligrp.tax.mapping.demarcate.Transformer; |
| @@ -27,13 +27,10 @@ public class ReceiptTransformer extends Transformer<ReceiptMapping> { | @@ -27,13 +27,10 @@ public class ReceiptTransformer extends Transformer<ReceiptMapping> { | ||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | @Override | 29 | @Override |
| 30 | - public ReceiptMapping transform(BaseDocument document, TenantPipeline tenantPipeline) { | 30 | + public ReceiptMapping transform(BaseDocument document, PipelineDO pipelineDO) { |
| 31 | ReceiptBill bill = (ReceiptBill) document; | 31 | ReceiptBill bill = (ReceiptBill) document; |
| 32 | ReceiptMapping mapping = MappingUtils.convertValue(bill,ReceiptMapping.class); | 32 | ReceiptMapping mapping = MappingUtils.convertValue(bill,ReceiptMapping.class); |
| 33 | - List<String> verifyKeys = getVerifyKeys(tenantPipeline.getId()); | ||
| 34 | - String returnKeys = getReturnKeys(tenantPipeline.getId()); | ||
| 35 | - Optional.ofNullable(verifyKeys).ifPresent(e -> mapping.setVerifyInformation(getVerifyString(verifyKeys, mapping))); | ||
| 36 | - Optional.ofNullable(returnKeys).ifPresent(mapping::setReturnKeys); | 33 | + setValidKeys(pipelineDO,mapping); |
| 37 | return mapping; | 34 | return mapping; |
| 38 | } | 35 | } |
| 39 | } | 36 | } |
tax-map/src/main/java/com/diligrp/tax/mapping/demarcate/kingdee/ReceivableTransformer.java
| @@ -3,15 +3,12 @@ package com.diligrp.tax.mapping.demarcate.kingdee; | @@ -3,15 +3,12 @@ package com.diligrp.tax.mapping.demarcate.kingdee; | ||
| 3 | import com.diligrp.tax.central.domain.BaseDocument; | 3 | import com.diligrp.tax.central.domain.BaseDocument; |
| 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceivableBill; | 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.ReceivableBill; |
| 5 | import com.diligrp.tax.central.domain.mapping.kingdee.ReceivableMapping; | 5 | import com.diligrp.tax.central.domain.mapping.kingdee.ReceivableMapping; |
| 6 | -import com.diligrp.tax.central.model.TenantPipeline; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | import com.diligrp.tax.central.type.DocumentType; | 7 | import com.diligrp.tax.central.type.DocumentType; |
| 8 | import com.diligrp.tax.central.utils.MappingUtils; | 8 | import com.diligrp.tax.central.utils.MappingUtils; |
| 9 | import com.diligrp.tax.mapping.demarcate.Transformer; | 9 | import com.diligrp.tax.mapping.demarcate.Transformer; |
| 10 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| 11 | 11 | ||
| 12 | -import java.util.List; | ||
| 13 | -import java.util.Optional; | ||
| 14 | - | ||
| 15 | 12 | ||
| 16 | /** | 13 | /** |
| 17 | * @Author: zhangmeiyang | 14 | * @Author: zhangmeiyang |
| @@ -27,13 +24,10 @@ public class ReceivableTransformer extends Transformer<ReceivableMapping> { | @@ -27,13 +24,10 @@ public class ReceivableTransformer extends Transformer<ReceivableMapping> { | ||
| 27 | } | 24 | } |
| 28 | 25 | ||
| 29 | @Override | 26 | @Override |
| 30 | - public ReceivableMapping transform(BaseDocument document, TenantPipeline tenantPipeline) { | 27 | + public ReceivableMapping transform(BaseDocument document, PipelineDO pipelineDO) { |
| 31 | ReceivableBill bill = (ReceivableBill) document; | 28 | ReceivableBill bill = (ReceivableBill) document; |
| 32 | - ReceivableMapping mapping = MappingUtils.convertValue(bill,ReceivableMapping.class); | ||
| 33 | - List<String> verifyKeys = getVerifyKeys(tenantPipeline.getId()); | ||
| 34 | - String returnKeys = getReturnKeys(tenantPipeline.getId()); | ||
| 35 | - Optional.ofNullable(verifyKeys).ifPresent(e -> mapping.setVerifyInformation(getVerifyString(verifyKeys, mapping))); | ||
| 36 | - Optional.ofNullable(returnKeys).ifPresent(mapping::setReturnKeys); | 29 | + ReceivableMapping mapping = MappingUtils.convertValue(bill, ReceivableMapping.class); |
| 30 | + setValidKeys(pipelineDO, mapping); | ||
| 37 | return mapping; | 31 | return mapping; |
| 38 | } | 32 | } |
| 39 | } | 33 | } |
tax-map/src/main/java/com/diligrp/tax/mapping/demarcate/kingdee/RefundTransformer.java
| @@ -3,7 +3,7 @@ package com.diligrp.tax.mapping.demarcate.kingdee; | @@ -3,7 +3,7 @@ package com.diligrp.tax.mapping.demarcate.kingdee; | ||
| 3 | import com.diligrp.tax.central.domain.BaseDocument; | 3 | import com.diligrp.tax.central.domain.BaseDocument; |
| 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.RefundBill; | 4 | import com.diligrp.tax.central.domain.document.kingdee.bill.RefundBill; |
| 5 | import com.diligrp.tax.central.domain.mapping.kingdee.RefundMapping; | 5 | import com.diligrp.tax.central.domain.mapping.kingdee.RefundMapping; |
| 6 | -import com.diligrp.tax.central.model.TenantPipeline; | 6 | +import com.diligrp.tax.central.model.PipelineDO; |
| 7 | import com.diligrp.tax.central.type.DocumentType; | 7 | import com.diligrp.tax.central.type.DocumentType; |
| 8 | import com.diligrp.tax.central.utils.MappingUtils; | 8 | import com.diligrp.tax.central.utils.MappingUtils; |
| 9 | import com.diligrp.tax.mapping.demarcate.Transformer; | 9 | import com.diligrp.tax.mapping.demarcate.Transformer; |
| @@ -27,11 +27,11 @@ public class RefundTransformer extends Transformer<RefundMapping> { | @@ -27,11 +27,11 @@ public class RefundTransformer extends Transformer<RefundMapping> { | ||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | @Override | 29 | @Override |
| 30 | - public RefundMapping transform(BaseDocument document, TenantPipeline tenantPipeline) { | 30 | + public RefundMapping transform(BaseDocument document, PipelineDO pipelineDO) { |
| 31 | RefundBill bill = (RefundBill) document; | 31 | RefundBill bill = (RefundBill) document; |
| 32 | RefundMapping mapping = MappingUtils.convertValue(bill,RefundMapping.class); | 32 | RefundMapping mapping = MappingUtils.convertValue(bill,RefundMapping.class); |
| 33 | - List<String> verifyKeys = getVerifyKeys(tenantPipeline.getId()); | ||
| 34 | - String returnKeys = getReturnKeys(tenantPipeline.getId()); | 33 | + List<String> verifyKeys = getVerifyKeys(pipelineDO.getId()); |
| 34 | + String returnKeys = getReturnKeys(pipelineDO.getId()); | ||
| 35 | Optional.ofNullable(verifyKeys).ifPresent(e -> mapping.setVerifyInformation(getVerifyString(verifyKeys, mapping))); | 35 | Optional.ofNullable(verifyKeys).ifPresent(e -> mapping.setVerifyInformation(getVerifyString(verifyKeys, mapping))); |
| 36 | Optional.ofNullable(returnKeys).ifPresent(mapping::setReturnKeys); | 36 | Optional.ofNullable(returnKeys).ifPresent(mapping::setReturnKeys); |
| 37 | return mapping; | 37 | return mapping; |
tax-map/src/main/java/com/diligrp/tax/mapping/process/kingdee/MappingProcessor.java
| @@ -2,11 +2,7 @@ package com.diligrp.tax.mapping.process.kingdee; | @@ -2,11 +2,7 @@ package com.diligrp.tax.mapping.process.kingdee; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.domain.MessageContext; | 3 | import com.diligrp.tax.central.domain.MessageContext; |
| 4 | import com.diligrp.tax.central.domain.BaseMapping; | 4 | import com.diligrp.tax.central.domain.BaseMapping; |
| 5 | -import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 6 | import com.diligrp.tax.central.process.AbstractProcessor; | 5 | import com.diligrp.tax.central.process.AbstractProcessor; |
| 7 | -import com.diligrp.tax.central.type.DocumentType; | ||
| 8 | -import com.diligrp.tax.central.type.SystemType; | ||
| 9 | -import com.diligrp.tax.central.type.TaxSystemType; | ||
| 10 | import com.diligrp.tax.central.utils.JsonUtils; | 6 | import com.diligrp.tax.central.utils.JsonUtils; |
| 11 | import com.diligrp.tax.mapping.context.MappingContext; | 7 | import com.diligrp.tax.mapping.context.MappingContext; |
| 12 | import com.diligrp.tax.mapping.demarcate.Transformer; | 8 | import com.diligrp.tax.mapping.demarcate.Transformer; |
| @@ -29,7 +25,7 @@ public class MappingProcessor extends AbstractProcessor { | @@ -29,7 +25,7 @@ public class MappingProcessor extends AbstractProcessor { | ||
| 29 | @Override | 25 | @Override |
| 30 | public MessageContext process(MessageContext messageContext) { | 26 | public MessageContext process(MessageContext messageContext) { |
| 31 | Transformer<?> transformer = MappingContext.CONTEXT.get(messageContext.getDocumentTypeEnum()); | 27 | Transformer<?> transformer = MappingContext.CONTEXT.get(messageContext.getDocumentTypeEnum()); |
| 32 | - BaseMapping transform = transformer.transform(messageContext.getDocumentObject(),messageContext.getTenantPipeline()); | 28 | + BaseMapping transform = transformer.transform(messageContext.getDocumentObject(),messageContext.getPipelineDO()); |
| 33 | messageContext.setMappingObject(transform); | 29 | messageContext.setMappingObject(transform); |
| 34 | Map<String,Object> map = JsonUtils.convertValue(transform, new TypeReference<>() {}); | 30 | Map<String,Object> map = JsonUtils.convertValue(transform, new TypeReference<>() {}); |
| 35 | log.info("转换结果,{}", JsonUtils.toJsonString(map)); | 31 | log.info("转换结果,{}", JsonUtils.toJsonString(map)); |
tax-proxy/src/main/java/com/diligrp/tax/proxy/process/kingdee/ProxyProcessor.java
| @@ -23,7 +23,7 @@ public class ProxyProcessor extends AbstractProcessor { | @@ -23,7 +23,7 @@ public class ProxyProcessor extends AbstractProcessor { | ||
| 23 | @Override | 23 | @Override |
| 24 | public MessageContext process(MessageContext messageContext) { | 24 | public MessageContext process(MessageContext messageContext) { |
| 25 | AbstractConnectionManager<?> abstractConnectionManager = ConnectionContext.CONNECTION_MAP.get(messageContext.getSystemTypeEnum()); | 25 | AbstractConnectionManager<?> abstractConnectionManager = ConnectionContext.CONNECTION_MAP.get(messageContext.getSystemTypeEnum()); |
| 26 | - IdentifyInfo identifyInfo = (IdentifyInfo) abstractConnectionManager.getConnection(messageContext.getTenantPipeline()); | 26 | + IdentifyInfo identifyInfo = (IdentifyInfo) abstractConnectionManager.getConnection(messageContext.getPipelineDO()); |
| 27 | BaseProxy send = ProxyContext.CONTEXT.get(messageContext.getDocumentTypeEnum()).send(messageContext.getMappingObject(), identifyInfo); | 27 | BaseProxy send = ProxyContext.CONTEXT.get(messageContext.getDocumentTypeEnum()).send(messageContext.getMappingObject(), identifyInfo); |
| 28 | messageContext.setPipelineDataId(send.getThirdPartyId()); | 28 | messageContext.setPipelineDataId(send.getThirdPartyId()); |
| 29 | messageContext.setProxyObject(send); | 29 | messageContext.setProxyObject(send); |
tax-storage/src/main/java/com/diligrp/tax/storage/api/PipelineBusinessApi.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.api; | ||
| 2 | - | ||
| 3 | -import com.diligrp.tax.storage.api.request.PipelineBusinessRequest; | ||
| 4 | -import com.diligrp.tax.storage.api.service.PipelineBusinessService; | ||
| 5 | -import com.diligrp.tax.central.message.Message; | ||
| 6 | -import jakarta.annotation.Resource; | ||
| 7 | -import org.springframework.web.bind.annotation.RequestBody; | ||
| 8 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.RestController; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * @Author: zhangmeiyang | ||
| 13 | - * @CreateTime: 2025-11-13 18:14 | ||
| 14 | - * @Version: todo | ||
| 15 | - */ | ||
| 16 | -@RestController | ||
| 17 | -@RequestMapping("remote/tax/pipeline/info") | ||
| 18 | -public class PipelineBusinessApi { | ||
| 19 | - | ||
| 20 | - @Resource | ||
| 21 | - private PipelineBusinessService pipelineBusinessService; | ||
| 22 | - | ||
| 23 | - /** | ||
| 24 | - * 获取商家信息 | ||
| 25 | - * | ||
| 26 | - * @param request 请求 | ||
| 27 | - * @return {@link Message }<{@link ? }> | ||
| 28 | - */ | ||
| 29 | - @RequestMapping("getBusinessInfo") | ||
| 30 | - public Message<?> getBusinessInfo(@RequestBody PipelineBusinessRequest request) { | ||
| 31 | - return Message.success(pipelineBusinessService.getBusinessInfo(request)); | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/api/request/PipelineBusinessRequest.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.api.request; | ||
| 2 | - | ||
| 3 | -import jakarta.validation.constraints.NotEmpty; | ||
| 4 | -import lombok.Data; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * @Author: zhangmeiyang | ||
| 8 | - * @CreateTime: 2025-11-13 18:17 | ||
| 9 | - * @Version: todo | ||
| 10 | - */ | ||
| 11 | -@Data | ||
| 12 | -public class PipelineBusinessRequest { | ||
| 13 | - @NotEmpty | ||
| 14 | - private String group; | ||
| 15 | - @NotEmpty | ||
| 16 | - private String entity; | ||
| 17 | - @NotEmpty | ||
| 18 | - private String pipelineCode; | ||
| 19 | - @NotEmpty | ||
| 20 | - private String systemType; | ||
| 21 | - @NotEmpty | ||
| 22 | - private String businessCode; | ||
| 23 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/api/response/PipelineBusinessResponse.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.api.response; | ||
| 2 | - | ||
| 3 | -import lombok.Getter; | ||
| 4 | -import lombok.Setter; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * @Author: zhangmeiyang | ||
| 8 | - * @CreateTime: 2025-11-13 18:21 | ||
| 9 | - * @Version: todo | ||
| 10 | - */ | ||
| 11 | -@Getter | ||
| 12 | -@Setter | ||
| 13 | -public class PipelineBusinessResponse { | ||
| 14 | - /** | ||
| 15 | - * | ||
| 16 | - */ | ||
| 17 | - private Long id; | ||
| 18 | - | ||
| 19 | - /** | ||
| 20 | - * 账套ID | ||
| 21 | - */ | ||
| 22 | - private Long pipelineId; | ||
| 23 | - | ||
| 24 | - /** | ||
| 25 | - * 业务代码 | ||
| 26 | - */ | ||
| 27 | - private String businessCode; | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 业务名称 | ||
| 31 | - */ | ||
| 32 | - private String businessName; | ||
| 33 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/api/service/PipelineBusinessService.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.api.service; | ||
| 2 | - | ||
| 3 | -import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 4 | -import com.diligrp.tax.central.type.SystemType; | ||
| 5 | -import com.diligrp.tax.central.type.TaxSystemType; | ||
| 6 | -import com.diligrp.tax.storage.api.request.PipelineBusinessRequest; | ||
| 7 | -import com.diligrp.tax.storage.api.response.PipelineBusinessResponse; | ||
| 8 | -import com.diligrp.tax.storage.model.vo.TaxPipelineVO; | ||
| 9 | -import com.diligrp.tax.storage.model.vo.TaxTenantVO; | ||
| 10 | -import com.diligrp.tax.storage.service.TaxPipelineBusinessConfigService; | ||
| 11 | -import com.diligrp.tax.storage.service.TaxPipelineService; | ||
| 12 | -import com.diligrp.tax.storage.service.TaxTenantService; | ||
| 13 | -import jakarta.annotation.Resource; | ||
| 14 | -import org.springframework.stereotype.Service; | ||
| 15 | - | ||
| 16 | -import java.util.Objects; | ||
| 17 | -import java.util.Optional; | ||
| 18 | - | ||
| 19 | -/** | ||
| 20 | - * @Author: zhangmeiyang | ||
| 21 | - * @CreateTime: 2025-11-13 18:22 | ||
| 22 | - * @Version: todo | ||
| 23 | - */ | ||
| 24 | -@Service | ||
| 25 | -public class PipelineBusinessService { | ||
| 26 | - | ||
| 27 | - @Resource | ||
| 28 | - private TaxTenantService taxTenantService; | ||
| 29 | - | ||
| 30 | - @Resource | ||
| 31 | - private TaxPipelineService taxPipelineService; | ||
| 32 | - | ||
| 33 | - @Resource | ||
| 34 | - private TaxPipelineBusinessConfigService taxPipelineBusinessConfigService; | ||
| 35 | - | ||
| 36 | - public PipelineBusinessResponse getBusinessInfo(PipelineBusinessRequest request) { | ||
| 37 | - TaxTenantVO tenant = taxTenantService.getTenant(request.getGroup(), request.getEntity()); | ||
| 38 | - TaxPipelineVO taxPipelineVO = taxPipelineService.getByTenantIdAndCode(tenant.getId(), request.getPipelineCode()); | ||
| 39 | - Optional.ofNullable(request.getSystemType()).ifPresent(SystemType::validateSystemCode); | ||
| 40 | - if (!Objects.equals(SystemType.from(request.getSystemType()), SystemType.from(taxPipelineVO.getSystemCode()))) { | ||
| 41 | - throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "系统类型不匹配"); | ||
| 42 | - } | ||
| 43 | - return taxPipelineBusinessConfigService.getByPipelineIdAndBusinessCode(taxPipelineVO.getId(), request.getBusinessCode()); | ||
| 44 | - } | ||
| 45 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/controller/TaxPipelineController.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/controller/PipelineApi.java
| @@ -3,8 +3,8 @@ package com.diligrp.tax.storage.controller; | @@ -3,8 +3,8 @@ package com.diligrp.tax.storage.controller; | ||
| 3 | import com.diligrp.tax.central.message.Valid; | 3 | import com.diligrp.tax.central.message.Valid; |
| 4 | import com.diligrp.tax.storage.anno.RebuildIndex; | 4 | import com.diligrp.tax.storage.anno.RebuildIndex; |
| 5 | import com.diligrp.tax.central.message.Message; | 5 | import com.diligrp.tax.central.message.Message; |
| 6 | -import com.diligrp.tax.storage.model.co.TaxPipelineCO; | ||
| 7 | -import com.diligrp.tax.storage.service.TaxPipelineService; | 6 | +import com.diligrp.tax.storage.model.co.PipelineCO; |
| 7 | +import com.diligrp.tax.storage.service.PipelineService; | ||
| 8 | import com.diligrp.tax.storage.type.StateType; | 8 | import com.diligrp.tax.storage.type.StateType; |
| 9 | import jakarta.annotation.Resource; | 9 | import jakarta.annotation.Resource; |
| 10 | import org.springframework.validation.annotation.Validated; | 10 | import org.springframework.validation.annotation.Validated; |
| @@ -20,10 +20,10 @@ import org.springframework.web.bind.annotation.RestController; | @@ -20,10 +20,10 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 20 | */ | 20 | */ |
| 21 | @RestController | 21 | @RestController |
| 22 | @RequestMapping("/tax/tenant/pipeline") | 22 | @RequestMapping("/tax/tenant/pipeline") |
| 23 | -public class TaxPipelineController { | 23 | +public class PipelineApi { |
| 24 | 24 | ||
| 25 | @Resource | 25 | @Resource |
| 26 | - private TaxPipelineService taxPipelineService; | 26 | + private PipelineService pipelineService; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 保存账套 | 29 | * 保存账套 |
| @@ -33,8 +33,8 @@ public class TaxPipelineController { | @@ -33,8 +33,8 @@ public class TaxPipelineController { | ||
| 33 | */ | 33 | */ |
| 34 | @RequestMapping("/save") | 34 | @RequestMapping("/save") |
| 35 | @RebuildIndex | 35 | @RebuildIndex |
| 36 | - public Message<?> save(@RequestBody @Validated(value = Valid.Create.class) TaxPipelineCO taxPipeline) { | ||
| 37 | - taxPipelineService.save(taxPipeline); | 36 | + public Message<?> save(@RequestBody @Validated(value = Valid.Create.class) PipelineCO taxPipeline) { |
| 37 | + pipelineService.save(taxPipeline); | ||
| 38 | return Message.success(); | 38 | return Message.success(); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| @@ -46,8 +46,8 @@ public class TaxPipelineController { | @@ -46,8 +46,8 @@ public class TaxPipelineController { | ||
| 46 | */ | 46 | */ |
| 47 | @RequestMapping("/update") | 47 | @RequestMapping("/update") |
| 48 | @RebuildIndex | 48 | @RebuildIndex |
| 49 | - public Message<?> update(@RequestBody @Validated(value = Valid.Update.class) TaxPipelineCO taxPipeline) { | ||
| 50 | - taxPipelineService.update(taxPipeline); | 49 | + public Message<?> update(@RequestBody @Validated(value = Valid.Update.class) PipelineCO taxPipeline) { |
| 50 | + pipelineService.update(taxPipeline); | ||
| 51 | return Message.success(); | 51 | return Message.success(); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| @@ -60,7 +60,7 @@ public class TaxPipelineController { | @@ -60,7 +60,7 @@ public class TaxPipelineController { | ||
| 60 | */ | 60 | */ |
| 61 | @RequestMapping("/listByTenant/{group}/{entity}") | 61 | @RequestMapping("/listByTenant/{group}/{entity}") |
| 62 | public Message<?> listByTenant(@PathVariable("group") String group, @PathVariable("entity") String entity) { | 62 | public Message<?> listByTenant(@PathVariable("group") String group, @PathVariable("entity") String entity) { |
| 63 | - return Message.success(taxPipelineService.listByTenant(group, entity)); | 63 | + return Message.success(pipelineService.listByTenant(group, entity)); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | 66 | ||
| @@ -72,7 +72,7 @@ public class TaxPipelineController { | @@ -72,7 +72,7 @@ public class TaxPipelineController { | ||
| 72 | */ | 72 | */ |
| 73 | @RequestMapping("/get/{id}") | 73 | @RequestMapping("/get/{id}") |
| 74 | public Message<?> get(@PathVariable("id") Long id) { | 74 | public Message<?> get(@PathVariable("id") Long id) { |
| 75 | - return Message.success(taxPipelineService.get(id)); | 75 | + return Message.success(pipelineService.get(id)); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /** | 78 | /** |
| @@ -84,7 +84,7 @@ public class TaxPipelineController { | @@ -84,7 +84,7 @@ public class TaxPipelineController { | ||
| 84 | @RequestMapping("/disable/{id}") | 84 | @RequestMapping("/disable/{id}") |
| 85 | @RebuildIndex | 85 | @RebuildIndex |
| 86 | public Message<?> disable(@PathVariable("id") Long id) { | 86 | public Message<?> disable(@PathVariable("id") Long id) { |
| 87 | - taxPipelineService.updateState(id, StateType.DISABLE); | 87 | + pipelineService.updateState(id, StateType.DISABLE); |
| 88 | return Message.success(); | 88 | return Message.success(); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| @@ -97,7 +97,7 @@ public class TaxPipelineController { | @@ -97,7 +97,7 @@ public class TaxPipelineController { | ||
| 97 | @RequestMapping("/enable/{id}") | 97 | @RequestMapping("/enable/{id}") |
| 98 | @RebuildIndex | 98 | @RebuildIndex |
| 99 | public Message<?> enable(@PathVariable("id") Long id) { | 99 | public Message<?> enable(@PathVariable("id") Long id) { |
| 100 | - taxPipelineService.updateState(id, StateType.ENABLE); | 100 | + pipelineService.updateState(id, StateType.ENABLE); |
| 101 | return Message.success(); | 101 | return Message.success(); |
| 102 | } | 102 | } |
| 103 | 103 |
tax-storage/src/main/java/com/diligrp/tax/storage/controller/TaxPipelineBusinessConfigController.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/controller/PipelineBusinessApi.java
| @@ -3,7 +3,7 @@ package com.diligrp.tax.storage.controller; | @@ -3,7 +3,7 @@ package com.diligrp.tax.storage.controller; | ||
| 3 | import com.diligrp.tax.central.message.Valid; | 3 | import com.diligrp.tax.central.message.Valid; |
| 4 | import com.diligrp.tax.central.message.Message; | 4 | import com.diligrp.tax.central.message.Message; |
| 5 | import com.diligrp.tax.storage.model.co.*; | 5 | import com.diligrp.tax.storage.model.co.*; |
| 6 | -import com.diligrp.tax.storage.service.TaxPipelineBusinessConfigService; | 6 | +import com.diligrp.tax.storage.service.PipelineBusinessService; |
| 7 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 8 | import org.springframework.validation.annotation.Validated; | 8 | import org.springframework.validation.annotation.Validated; |
| 9 | import org.springframework.web.bind.annotation.PathVariable; | 9 | import org.springframework.web.bind.annotation.PathVariable; |
| @@ -20,10 +20,10 @@ import java.util.List; | @@ -20,10 +20,10 @@ import java.util.List; | ||
| 20 | */ | 20 | */ |
| 21 | @RestController | 21 | @RestController |
| 22 | @RequestMapping("/tax/tenant/pipeline/business/config") | 22 | @RequestMapping("/tax/tenant/pipeline/business/config") |
| 23 | -public class TaxPipelineBusinessConfigController { | 23 | +public class PipelineBusinessApi { |
| 24 | 24 | ||
| 25 | @Resource | 25 | @Resource |
| 26 | - private TaxPipelineBusinessConfigService taxPipelineBusinessConfigService; | 26 | + private PipelineBusinessService pipelineBusinessService; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 保存业务 | 29 | * 保存业务 |
| @@ -32,8 +32,8 @@ public class TaxPipelineBusinessConfigController { | @@ -32,8 +32,8 @@ public class TaxPipelineBusinessConfigController { | ||
| 32 | * @return {@link Message }<{@link ? }> | 32 | * @return {@link Message }<{@link ? }> |
| 33 | */ | 33 | */ |
| 34 | @RequestMapping("/saveBusiness") | 34 | @RequestMapping("/saveBusiness") |
| 35 | - public Message<?> saveBusiness(@RequestBody @Validated(value = Valid.Create.class) TaxPipelineBusinessCO co) { | ||
| 36 | - taxPipelineBusinessConfigService.saveBusiness(co); | 35 | + public Message<?> saveBusiness(@RequestBody @Validated(value = Valid.Create.class) PipelineBusinessCO co) { |
| 36 | + pipelineBusinessService.saveBusiness(co); | ||
| 37 | return Message.success(); | 37 | return Message.success(); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| @@ -44,8 +44,8 @@ public class TaxPipelineBusinessConfigController { | @@ -44,8 +44,8 @@ public class TaxPipelineBusinessConfigController { | ||
| 44 | * @return {@link Message }<{@link ? }> | 44 | * @return {@link Message }<{@link ? }> |
| 45 | */ | 45 | */ |
| 46 | @RequestMapping("/updateBusiness") | 46 | @RequestMapping("/updateBusiness") |
| 47 | - public Message<?> updateBusiness(@RequestBody @Validated(value = Valid.Update.class) TaxPipelineBusinessCO co) { | ||
| 48 | - taxPipelineBusinessConfigService.updateBusiness(co); | 47 | + public Message<?> updateBusiness(@RequestBody @Validated(value = Valid.Update.class) PipelineBusinessCO co) { |
| 48 | + pipelineBusinessService.updateBusiness(co); | ||
| 49 | return Message.success(); | 49 | return Message.success(); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| @@ -57,7 +57,7 @@ public class TaxPipelineBusinessConfigController { | @@ -57,7 +57,7 @@ public class TaxPipelineBusinessConfigController { | ||
| 57 | */ | 57 | */ |
| 58 | @RequestMapping("/deleteBusiness/{id}") | 58 | @RequestMapping("/deleteBusiness/{id}") |
| 59 | public Message<?> deleteBusiness(@PathVariable("id") Long id) { | 59 | public Message<?> deleteBusiness(@PathVariable("id") Long id) { |
| 60 | - taxPipelineBusinessConfigService.deleteBusiness(id); | 60 | + pipelineBusinessService.deleteBusiness(id); |
| 61 | return Message.success(); | 61 | return Message.success(); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| @@ -68,8 +68,8 @@ public class TaxPipelineBusinessConfigController { | @@ -68,8 +68,8 @@ public class TaxPipelineBusinessConfigController { | ||
| 68 | * @return {@link Message }<{@link ? }> | 68 | * @return {@link Message }<{@link ? }> |
| 69 | */ | 69 | */ |
| 70 | @RequestMapping("/pageBusiness") | 70 | @RequestMapping("/pageBusiness") |
| 71 | - public Message<?> pageBusiness(@RequestBody @Validated(value = Valid.Read.class) TaxPipelineBusinessCO co) { | ||
| 72 | - return Message.success(taxPipelineBusinessConfigService.pageBusiness(co)); | 71 | + public Message<?> pageBusiness(@RequestBody @Validated(value = Valid.Read.class) PipelineBusinessCO co) { |
| 72 | + return Message.success(pipelineBusinessService.pageBusiness(co)); | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| @@ -79,8 +79,8 @@ public class TaxPipelineBusinessConfigController { | @@ -79,8 +79,8 @@ public class TaxPipelineBusinessConfigController { | ||
| 79 | * @return {@link Message }<{@link ? }> | 79 | * @return {@link Message }<{@link ? }> |
| 80 | */ | 80 | */ |
| 81 | @RequestMapping("/keyword/batchSaveBusinessKeyword") | 81 | @RequestMapping("/keyword/batchSaveBusinessKeyword") |
| 82 | - public Message<?> batchSaveBusinessKeyword(@RequestBody @Validated(value = Valid.Create.class) List<TaxPipelineBusinessKeywordCO> cos) { | ||
| 83 | - taxPipelineBusinessConfigService.batchSaveBusinessKeyword(cos); | 82 | + public Message<?> batchSaveBusinessKeyword(@RequestBody @Validated(value = Valid.Create.class) List<PipelineBusinessKeywordCO> cos) { |
| 83 | + pipelineBusinessService.batchSaveBusinessKeyword(cos); | ||
| 84 | return Message.success(); | 84 | return Message.success(); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| @@ -91,8 +91,8 @@ public class TaxPipelineBusinessConfigController { | @@ -91,8 +91,8 @@ public class TaxPipelineBusinessConfigController { | ||
| 91 | * @return {@link Message }<{@link ? }> | 91 | * @return {@link Message }<{@link ? }> |
| 92 | */ | 92 | */ |
| 93 | @RequestMapping("/keyword/saveBusinessKeyword") | 93 | @RequestMapping("/keyword/saveBusinessKeyword") |
| 94 | - public Message<?> saveBusinessKeyword(@RequestBody @Validated(value = Valid.Create.class) TaxPipelineBusinessKeywordCO co) { | ||
| 95 | - taxPipelineBusinessConfigService.saveBusinessKeyword(co); | 94 | + public Message<?> saveBusinessKeyword(@RequestBody @Validated(value = Valid.Create.class) PipelineBusinessKeywordCO co) { |
| 95 | + pipelineBusinessService.saveBusinessKeyword(co); | ||
| 96 | return Message.success(); | 96 | return Message.success(); |
| 97 | } | 97 | } |
| 98 | /** | 98 | /** |
| @@ -102,7 +102,7 @@ public class TaxPipelineBusinessConfigController { | @@ -102,7 +102,7 @@ public class TaxPipelineBusinessConfigController { | ||
| 102 | * @return {@link Message }<{@link ? }> | 102 | * @return {@link Message }<{@link ? }> |
| 103 | */ | 103 | */ |
| 104 | @RequestMapping("/keyword/listBusinessKeyword") | 104 | @RequestMapping("/keyword/listBusinessKeyword") |
| 105 | - public Message<?> listBusinessKeyword(@RequestBody @Validated(value = Valid.Read.class) TaxPipelineBusinessKeywordCO co) { | ||
| 106 | - return Message.success(taxPipelineBusinessConfigService.listBusinessKeyword(co)); | 105 | + public Message<?> listBusinessKeyword(@RequestBody @Validated(value = Valid.Read.class) PipelineBusinessKeywordCO co) { |
| 106 | + return Message.success(pipelineBusinessService.listBusinessKeyword(co)); | ||
| 107 | } | 107 | } |
| 108 | } | 108 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/controller/TaxPipelineFieldConfigController.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/controller/PipelineDocFieldApi.java
| @@ -2,8 +2,8 @@ package com.diligrp.tax.storage.controller; | @@ -2,8 +2,8 @@ package com.diligrp.tax.storage.controller; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.message.Valid; | 3 | import com.diligrp.tax.central.message.Valid; |
| 4 | import com.diligrp.tax.central.message.Message; | 4 | import com.diligrp.tax.central.message.Message; |
| 5 | -import com.diligrp.tax.storage.model.co.TaxPipelineFieldConfigCO; | ||
| 6 | -import com.diligrp.tax.storage.service.TaxPipelineFieldConfigService; | 5 | +import com.diligrp.tax.storage.model.co.PipelineDocFieldTypeCO; |
| 6 | +import com.diligrp.tax.storage.service.PipelineDocFieldTypeService; | ||
| 7 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 8 | import org.springframework.validation.annotation.Validated; | 8 | import org.springframework.validation.annotation.Validated; |
| 9 | import org.springframework.web.bind.annotation.PathVariable; | 9 | import org.springframework.web.bind.annotation.PathVariable; |
| @@ -18,10 +18,10 @@ import org.springframework.web.bind.annotation.RestController; | @@ -18,10 +18,10 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 18 | */ | 18 | */ |
| 19 | @RestController | 19 | @RestController |
| 20 | @RequestMapping("/tax/tenant/pipeline/field/config") | 20 | @RequestMapping("/tax/tenant/pipeline/field/config") |
| 21 | -public class TaxPipelineFieldConfigController { | 21 | +public class PipelineDocFieldApi { |
| 22 | 22 | ||
| 23 | @Resource | 23 | @Resource |
| 24 | - private TaxPipelineFieldConfigService taxPipelineFieldConfigService; | 24 | + private PipelineDocFieldTypeService pipelineDocFieldTypeService; |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * 列出所有单据 | 27 | * 列出所有单据 |
| @@ -30,7 +30,7 @@ public class TaxPipelineFieldConfigController { | @@ -30,7 +30,7 @@ public class TaxPipelineFieldConfigController { | ||
| 30 | */ | 30 | */ |
| 31 | @RequestMapping("/listDocument/{systemType}") | 31 | @RequestMapping("/listDocument/{systemType}") |
| 32 | public Message<?> listDocument(@PathVariable("systemType") String systemType) { | 32 | public Message<?> listDocument(@PathVariable("systemType") String systemType) { |
| 33 | - return Message.success(taxPipelineFieldConfigService.listDocumentBySystemType(systemType)); | 33 | + return Message.success(pipelineDocFieldTypeService.listDocumentBySystemType(systemType)); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | 36 | ||
| @@ -43,7 +43,7 @@ public class TaxPipelineFieldConfigController { | @@ -43,7 +43,7 @@ public class TaxPipelineFieldConfigController { | ||
| 43 | */ | 43 | */ |
| 44 | @RequestMapping("/listField/{systemType}/{documentType}") | 44 | @RequestMapping("/listField/{systemType}/{documentType}") |
| 45 | public Message<?> listField(@PathVariable("systemType") String systemType, @PathVariable("documentType") String documentType) { | 45 | public Message<?> listField(@PathVariable("systemType") String systemType, @PathVariable("documentType") String documentType) { |
| 46 | - return Message.success(taxPipelineFieldConfigService.listFieldBySystemTypeAndDocumentType(systemType, documentType)); | 46 | + return Message.success(pipelineDocFieldTypeService.listFieldBySystemTypeAndDocumentType(systemType, documentType)); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | 49 | ||
| @@ -54,8 +54,8 @@ public class TaxPipelineFieldConfigController { | @@ -54,8 +54,8 @@ public class TaxPipelineFieldConfigController { | ||
| 54 | * @return {@link Message }<{@link ? }> | 54 | * @return {@link Message }<{@link ? }> |
| 55 | */ | 55 | */ |
| 56 | @RequestMapping("/save") | 56 | @RequestMapping("/save") |
| 57 | - public Message<?> save(@RequestBody @Validated(value = Valid.Create.class) TaxPipelineFieldConfigCO co) { | ||
| 58 | - taxPipelineFieldConfigService.save(co); | 57 | + public Message<?> save(@RequestBody @Validated(value = Valid.Create.class) PipelineDocFieldTypeCO co) { |
| 58 | + pipelineDocFieldTypeService.save(co); | ||
| 59 | return Message.success(); | 59 | return Message.success(); |
| 60 | } | 60 | } |
| 61 | 61 |
tax-storage/src/main/java/com/diligrp/tax/storage/controller/TaxPipelineFieldVerifyController.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/controller/PipelineDocValidApi.java
| @@ -2,9 +2,9 @@ package com.diligrp.tax.storage.controller; | @@ -2,9 +2,9 @@ package com.diligrp.tax.storage.controller; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.message.Valid; | 3 | import com.diligrp.tax.central.message.Valid; |
| 4 | import com.diligrp.tax.central.message.Message; | 4 | import com.diligrp.tax.central.message.Message; |
| 5 | -import com.diligrp.tax.storage.model.co.TaxPipelineFieldVerifyCO; | ||
| 6 | -import com.diligrp.tax.storage.model.co.TaxPipelineFieldVerifyReturnCO; | ||
| 7 | -import com.diligrp.tax.storage.service.TaxPipelineFieldVerifyService; | 5 | +import com.diligrp.tax.storage.model.co.PipelineDocValidCO; |
| 6 | +import com.diligrp.tax.storage.model.co.PipelineDocValidReturnCO; | ||
| 7 | +import com.diligrp.tax.storage.service.PipelineDocValidService; | ||
| 8 | import jakarta.annotation.Resource; | 8 | import jakarta.annotation.Resource; |
| 9 | import org.springframework.validation.annotation.Validated; | 9 | import org.springframework.validation.annotation.Validated; |
| 10 | import org.springframework.web.bind.annotation.PathVariable; | 10 | import org.springframework.web.bind.annotation.PathVariable; |
| @@ -21,10 +21,10 @@ import java.util.List; | @@ -21,10 +21,10 @@ import java.util.List; | ||
| 21 | */ | 21 | */ |
| 22 | @RestController | 22 | @RestController |
| 23 | @RequestMapping("/tax/tenant/pipeline/field/verify") | 23 | @RequestMapping("/tax/tenant/pipeline/field/verify") |
| 24 | -public class TaxPipelineFieldVerifyController { | 24 | +public class PipelineDocValidApi { |
| 25 | 25 | ||
| 26 | @Resource | 26 | @Resource |
| 27 | - private TaxPipelineFieldVerifyService taxPipelineFieldVerifyService; | 27 | + private PipelineDocValidService pipelineDocValidService; |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * 保存验证 | 30 | * 保存验证 |
| @@ -33,8 +33,8 @@ public class TaxPipelineFieldVerifyController { | @@ -33,8 +33,8 @@ public class TaxPipelineFieldVerifyController { | ||
| 33 | * @return {@link Message }<{@link ? }> | 33 | * @return {@link Message }<{@link ? }> |
| 34 | */ | 34 | */ |
| 35 | @RequestMapping("/saveVerify") | 35 | @RequestMapping("/saveVerify") |
| 36 | - public Message<?> saveVerify(@RequestBody @Validated(value = Valid.Create.class) List<TaxPipelineFieldVerifyCO> list) { | ||
| 37 | - taxPipelineFieldVerifyService.saveVerify(list); | 36 | + public Message<?> saveVerify(@RequestBody @Validated(value = Valid.Create.class) List<PipelineDocValidCO> list) { |
| 37 | + pipelineDocValidService.saveVerify(list); | ||
| 38 | return Message.success(); | 38 | return Message.success(); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| @@ -46,7 +46,7 @@ public class TaxPipelineFieldVerifyController { | @@ -46,7 +46,7 @@ public class TaxPipelineFieldVerifyController { | ||
| 46 | */ | 46 | */ |
| 47 | @RequestMapping("/deleteVerify/{id}") | 47 | @RequestMapping("/deleteVerify/{id}") |
| 48 | public Message<?> deleteVerify(@PathVariable Long id) { | 48 | public Message<?> deleteVerify(@PathVariable Long id) { |
| 49 | - taxPipelineFieldVerifyService.deleteVerify(id); | 49 | + pipelineDocValidService.deleteVerify(id); |
| 50 | return Message.success(); | 50 | return Message.success(); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| @@ -58,7 +58,7 @@ public class TaxPipelineFieldVerifyController { | @@ -58,7 +58,7 @@ public class TaxPipelineFieldVerifyController { | ||
| 58 | */ | 58 | */ |
| 59 | @RequestMapping("/listVerifyByPipeline/{pipelineId}") | 59 | @RequestMapping("/listVerifyByPipeline/{pipelineId}") |
| 60 | public Message<?> listVerifyByPipeline(@PathVariable String pipelineId) { | 60 | public Message<?> listVerifyByPipeline(@PathVariable String pipelineId) { |
| 61 | - return Message.success(taxPipelineFieldVerifyService.listVerifyByPipeline(pipelineId)); | 61 | + return Message.success(pipelineDocValidService.listVerifyByPipeline(pipelineId)); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | /** | 64 | /** |
| @@ -68,8 +68,8 @@ public class TaxPipelineFieldVerifyController { | @@ -68,8 +68,8 @@ public class TaxPipelineFieldVerifyController { | ||
| 68 | * @return {@link Message }<{@link ? }> | 68 | * @return {@link Message }<{@link ? }> |
| 69 | */ | 69 | */ |
| 70 | @RequestMapping("/listVerifyByPipelineAndDocument") | 70 | @RequestMapping("/listVerifyByPipelineAndDocument") |
| 71 | - public Message<?> listVerifyByPipelineAndDocument(@RequestBody @Validated(value = Valid.Read.class) TaxPipelineFieldVerifyCO co) { | ||
| 72 | - return Message.success(taxPipelineFieldVerifyService.listVerifyByPipelineAndDocument(co)); | 71 | + public Message<?> listVerifyByPipelineAndDocument(@RequestBody @Validated(value = Valid.Read.class) PipelineDocValidCO co) { |
| 72 | + return Message.success(pipelineDocValidService.listVerifyByPipelineAndDocument(co)); | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| @@ -79,8 +79,8 @@ public class TaxPipelineFieldVerifyController { | @@ -79,8 +79,8 @@ public class TaxPipelineFieldVerifyController { | ||
| 79 | * @return {@link Message }<{@link ? }> | 79 | * @return {@link Message }<{@link ? }> |
| 80 | */ | 80 | */ |
| 81 | @RequestMapping("/saveReturnKey") | 81 | @RequestMapping("/saveReturnKey") |
| 82 | - public Message<?> saveReturnKey(@RequestBody @Validated(value = Valid.Create.class) TaxPipelineFieldVerifyReturnCO co) { | ||
| 83 | - taxPipelineFieldVerifyService.saveReturnKey(co); | 82 | + public Message<?> saveReturnKey(@RequestBody @Validated(value = Valid.Create.class) PipelineDocValidReturnCO co) { |
| 83 | + pipelineDocValidService.saveReturnKey(co); | ||
| 84 | return Message.success(); | 84 | return Message.success(); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| @@ -92,7 +92,7 @@ public class TaxPipelineFieldVerifyController { | @@ -92,7 +92,7 @@ public class TaxPipelineFieldVerifyController { | ||
| 92 | */ | 92 | */ |
| 93 | @RequestMapping("/getReturnKeyByPipeline/{pipelineId}") | 93 | @RequestMapping("/getReturnKeyByPipeline/{pipelineId}") |
| 94 | public Message<?> getReturnKeyByPipeline(@PathVariable String pipelineId) { | 94 | public Message<?> getReturnKeyByPipeline(@PathVariable String pipelineId) { |
| 95 | - return Message.success(taxPipelineFieldVerifyService.getReturnKeyByPipeline(pipelineId)); | 95 | + return Message.success(pipelineDocValidService.getReturnKeyByPipeline(pipelineId)); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | /** | 98 | /** |
| @@ -102,7 +102,7 @@ public class TaxPipelineFieldVerifyController { | @@ -102,7 +102,7 @@ public class TaxPipelineFieldVerifyController { | ||
| 102 | * @return {@link Message }<{@link ? }> | 102 | * @return {@link Message }<{@link ? }> |
| 103 | */ | 103 | */ |
| 104 | @RequestMapping("/getReturnKeyByPipelineAndDocument") | 104 | @RequestMapping("/getReturnKeyByPipelineAndDocument") |
| 105 | - public Message<?> getReturnKeyByPipelineAndDocument(@RequestBody @Validated(value = Valid.Read.class) TaxPipelineFieldVerifyCO co) { | ||
| 106 | - return Message.success(taxPipelineFieldVerifyService.getReturnKeyByPipelineAndDocument(co)); | 105 | + public Message<?> getReturnKeyByPipelineAndDocument(@RequestBody @Validated(value = Valid.Read.class) PipelineDocValidCO co) { |
| 106 | + return Message.success(pipelineDocValidService.getReturnKeyByPipelineAndDocument(co)); | ||
| 107 | } | 107 | } |
| 108 | } | 108 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/controller/DynamicTaxPipelineMappingController.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/controller/PipelineMappingApi.java
| @@ -2,8 +2,8 @@ package com.diligrp.tax.storage.controller; | @@ -2,8 +2,8 @@ package com.diligrp.tax.storage.controller; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.message.Valid; | 3 | import com.diligrp.tax.central.message.Valid; |
| 4 | import com.diligrp.tax.central.message.Message; | 4 | import com.diligrp.tax.central.message.Message; |
| 5 | -import com.diligrp.tax.storage.model.co.TaxPipelineMappingCO; | ||
| 6 | -import com.diligrp.tax.storage.service.DynamicTaxPipelineMappingService; | 5 | +import com.diligrp.tax.storage.model.co.PipelineMappingCO; |
| 6 | +import com.diligrp.tax.storage.service.PipelineMappingService; | ||
| 7 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 8 | import org.springframework.validation.annotation.Validated; | 8 | import org.springframework.validation.annotation.Validated; |
| 9 | import org.springframework.web.bind.annotation.RequestBody; | 9 | import org.springframework.web.bind.annotation.RequestBody; |
| @@ -17,14 +17,14 @@ import org.springframework.web.bind.annotation.RestController; | @@ -17,14 +17,14 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 17 | */ | 17 | */ |
| 18 | @RestController | 18 | @RestController |
| 19 | @RequestMapping("/tax/tenant/pipeline/mapping") | 19 | @RequestMapping("/tax/tenant/pipeline/mapping") |
| 20 | -public class DynamicTaxPipelineMappingController { | 20 | +public class PipelineMappingApi { |
| 21 | 21 | ||
| 22 | @Resource | 22 | @Resource |
| 23 | - private DynamicTaxPipelineMappingService dynamicTaxPipelineMappingService; | 23 | + private PipelineMappingService pipelineMappingService; |
| 24 | 24 | ||
| 25 | @RequestMapping("page") | 25 | @RequestMapping("page") |
| 26 | - public Message<?> page(@RequestBody @Validated(value = {Valid.Read.class}) TaxPipelineMappingCO taxPipelineMappingCO) { | ||
| 27 | - return Message.success(dynamicTaxPipelineMappingService.findTenantPipelineData(taxPipelineMappingCO)); | 26 | + public Message<?> page(@RequestBody @Validated(value = {Valid.Read.class}) PipelineMappingCO pipelineMappingCO) { |
| 27 | + return Message.success(pipelineMappingService.findTenantPipelineData(pipelineMappingCO)); | ||
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | } | 30 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/controller/TaxTenantController.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/controller/TenantApi.java
| 1 | package com.diligrp.tax.storage.controller; | 1 | package com.diligrp.tax.storage.controller; |
| 2 | 2 | ||
| 3 | +import com.diligrp.tax.central.message.Message; | ||
| 3 | import com.diligrp.tax.central.message.Valid; | 4 | import com.diligrp.tax.central.message.Valid; |
| 4 | import com.diligrp.tax.storage.anno.RebuildIndex; | 5 | import com.diligrp.tax.storage.anno.RebuildIndex; |
| 5 | -import com.diligrp.tax.central.message.Message; | ||
| 6 | -import com.diligrp.tax.storage.model.co.TaxTenantCO; | ||
| 7 | -import com.diligrp.tax.storage.service.TaxTenantService; | 6 | +import com.diligrp.tax.storage.model.co.TenantCO; |
| 7 | +import com.diligrp.tax.storage.service.TenantService; | ||
| 8 | import jakarta.annotation.Resource; | 8 | import jakarta.annotation.Resource; |
| 9 | import org.springframework.validation.annotation.Validated; | 9 | import org.springframework.validation.annotation.Validated; |
| 10 | import org.springframework.web.bind.annotation.PathVariable; | 10 | import org.springframework.web.bind.annotation.PathVariable; |
| @@ -12,8 +12,6 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -12,8 +12,6 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 12 | import org.springframework.web.bind.annotation.RequestMapping; | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
| 13 | import org.springframework.web.bind.annotation.RestController; | 13 | import org.springframework.web.bind.annotation.RestController; |
| 14 | 14 | ||
| 15 | -import java.util.Map; | ||
| 16 | - | ||
| 17 | /** | 15 | /** |
| 18 | * 税务租户 | 16 | * 税务租户 |
| 19 | * | 17 | * |
| @@ -22,17 +20,10 @@ import java.util.Map; | @@ -22,17 +20,10 @@ import java.util.Map; | ||
| 22 | */ | 20 | */ |
| 23 | @RestController | 21 | @RestController |
| 24 | @RequestMapping("/tax/tenant") | 22 | @RequestMapping("/tax/tenant") |
| 25 | -public class TaxTenantController { | 23 | +public class TenantApi { |
| 26 | 24 | ||
| 27 | @Resource | 25 | @Resource |
| 28 | - private TaxTenantService taxTenantService; | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - @RequestMapping("call") | ||
| 32 | - public Message<?> call(@RequestBody Map<String, Object> map) { | ||
| 33 | - map.put("value","101"); | ||
| 34 | - return Message.success(map); | ||
| 35 | - } | 26 | + private TenantService tenantService; |
| 36 | 27 | ||
| 37 | /** | 28 | /** |
| 38 | * 获取 | 29 | * 获取 |
| @@ -43,43 +34,43 @@ public class TaxTenantController { | @@ -43,43 +34,43 @@ public class TaxTenantController { | ||
| 43 | */ | 34 | */ |
| 44 | @RequestMapping("/get/{group}/{entity}") | 35 | @RequestMapping("/get/{group}/{entity}") |
| 45 | public Message<?> get(@PathVariable("group") String group, @PathVariable("entity") String entity) { | 36 | public Message<?> get(@PathVariable("group") String group, @PathVariable("entity") String entity) { |
| 46 | - return Message.success(taxTenantService.getTenant(group, entity)); | 37 | + return Message.success(tenantService.getTenant(group, entity)); |
| 47 | } | 38 | } |
| 48 | 39 | ||
| 49 | /** | 40 | /** |
| 50 | * 保存 | 41 | * 保存 |
| 51 | * | 42 | * |
| 52 | - * @param taxTenantCO 税务租户做 | 43 | + * @param tenantCO 税务租户做 |
| 53 | * @return {@link Message }<{@link ? }> | 44 | * @return {@link Message }<{@link ? }> |
| 54 | */ | 45 | */ |
| 55 | @RequestMapping("/save") | 46 | @RequestMapping("/save") |
| 56 | @RebuildIndex | 47 | @RebuildIndex |
| 57 | - public Message<?> save(@RequestBody @Validated(value = {Valid.Create.class}) TaxTenantCO taxTenantCO) { | ||
| 58 | - taxTenantService.saveTenant(taxTenantCO); | 48 | + public Message<?> save(@RequestBody @Validated(value = {Valid.Create.class}) TenantCO tenantCO) { |
| 49 | + tenantService.saveTenant(tenantCO); | ||
| 59 | return Message.success(); | 50 | return Message.success(); |
| 60 | } | 51 | } |
| 61 | 52 | ||
| 62 | /** | 53 | /** |
| 63 | * 保存 | 54 | * 保存 |
| 64 | * | 55 | * |
| 65 | - * @param taxTenantCO 税务租户做 | 56 | + * @param tenantCO 税务租户做 |
| 66 | * @return {@link Message }<{@link ? }> | 57 | * @return {@link Message }<{@link ? }> |
| 67 | */ | 58 | */ |
| 68 | @RequestMapping("/update") | 59 | @RequestMapping("/update") |
| 69 | @RebuildIndex | 60 | @RebuildIndex |
| 70 | - public Message<?> update(@RequestBody @Validated(value = {Valid.Update.class}) TaxTenantCO taxTenantCO) { | ||
| 71 | - taxTenantService.updateTenant(taxTenantCO); | 61 | + public Message<?> update(@RequestBody @Validated(value = {Valid.Update.class}) TenantCO tenantCO) { |
| 62 | + tenantService.updateTenant(tenantCO); | ||
| 72 | return Message.success(); | 63 | return Message.success(); |
| 73 | } | 64 | } |
| 74 | 65 | ||
| 75 | /** | 66 | /** |
| 76 | * 分页查询 | 67 | * 分页查询 |
| 77 | * | 68 | * |
| 78 | - * @param taxTenantCO 税务租户做 | 69 | + * @param tenantCO 税务租户做 |
| 79 | * @return {@link Message }<{@link ? }> | 70 | * @return {@link Message }<{@link ? }> |
| 80 | */ | 71 | */ |
| 81 | @RequestMapping("page") | 72 | @RequestMapping("page") |
| 82 | - public Message<?> page(@RequestBody @Validated(value = {Valid.Read.class}) TaxTenantCO taxTenantCO) { | ||
| 83 | - return Message.success(taxTenantService.findByNameAndState(taxTenantCO)); | 73 | + public Message<?> page(@RequestBody @Validated(value = {Valid.Read.class}) TenantCO tenantCO) { |
| 74 | + return Message.success(tenantService.findByNameAndState(tenantCO)); | ||
| 84 | } | 75 | } |
| 85 | } | 76 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxMappingError.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/MappingError.java
| @@ -4,22 +4,21 @@ import com.baomidou.mybatisplus.annotation.IdType; | @@ -4,22 +4,21 @@ import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | import com.baomidou.mybatisplus.annotation.TableField; | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
| 5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | -import jakarta.validation.constraints.NotEmpty; | ||
| 8 | -import jakarta.validation.constraints.NotNull; | ||
| 9 | import lombok.Getter; | 7 | import lombok.Getter; |
| 10 | import lombok.Setter; | 8 | import lombok.Setter; |
| 11 | 9 | ||
| 12 | import java.time.LocalDateTime; | 10 | import java.time.LocalDateTime; |
| 13 | 11 | ||
| 14 | /** | 12 | /** |
| 15 | - * @Author: zhangmeiyang | ||
| 16 | - * @CreateTime: 2025-11-10 14:42 | ||
| 17 | - * @Version: todo | 13 | + * 映射错误信息 |
| 14 | + * | ||
| 15 | + * @author zhangmeiyang | ||
| 16 | + * @date 2025/11/26 | ||
| 18 | */ | 17 | */ |
| 19 | @Setter | 18 | @Setter |
| 20 | @Getter | 19 | @Getter |
| 21 | -@TableName(value = "tax_mapping_error") | ||
| 22 | -public class TaxMappingError { | 20 | +@TableName(value = "mapping_error") |
| 21 | +public class MappingError { | ||
| 23 | /** | 22 | /** |
| 24 | * id | 23 | * id |
| 25 | */ | 24 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipeline.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/Pipeline.java
| @@ -11,10 +11,16 @@ import lombok.Setter; | @@ -11,10 +11,16 @@ import lombok.Setter; | ||
| 11 | import java.time.LocalDateTime; | 11 | import java.time.LocalDateTime; |
| 12 | import java.util.Map; | 12 | import java.util.Map; |
| 13 | 13 | ||
| 14 | +/** | ||
| 15 | + * 管道 | ||
| 16 | + * | ||
| 17 | + * @author zhangmeiyang | ||
| 18 | + * @date 2025/11/26 | ||
| 19 | + */ | ||
| 14 | @Getter | 20 | @Getter |
| 15 | @Setter | 21 | @Setter |
| 16 | -@TableName(value = "tax_pipeline", autoResultMap = true) | ||
| 17 | -public class TaxPipeline { | 22 | +@TableName(value = "pipeline", autoResultMap = true) |
| 23 | +public class Pipeline { | ||
| 18 | @TableId(type = IdType.AUTO) | 24 | @TableId(type = IdType.AUTO) |
| 19 | private Long id; | 25 | private Long id; |
| 20 | 26 |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineBusiness.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineBusiness.java
| @@ -5,17 +5,21 @@ import com.baomidou.mybatisplus.annotation.TableField; | @@ -5,17 +5,21 @@ import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| 8 | +import lombok.Getter; | ||
| 9 | +import lombok.Setter; | ||
| 8 | 10 | ||
| 9 | import java.time.LocalDateTime; | 11 | import java.time.LocalDateTime; |
| 10 | 12 | ||
| 11 | /** | 13 | /** |
| 12 | * 账套业务配置 | 14 | * 账套业务配置 |
| 13 | * | 15 | * |
| 14 | - * @TableName tax_pipeline_business | 16 | + * @author zhangmeiyang |
| 17 | + * @date 2025/11/26 | ||
| 15 | */ | 18 | */ |
| 16 | -@TableName(value = "tax_pipeline_business") | ||
| 17 | -@Data | ||
| 18 | -public class TaxPipelineBusiness { | 19 | +@TableName(value = "pipeline_business") |
| 20 | +@Getter | ||
| 21 | +@Setter | ||
| 22 | +public class PipelineBusiness { | ||
| 19 | /** | 23 | /** |
| 20 | * | 24 | * |
| 21 | */ | 25 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineBusinessKeyword.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineBusinessKeyword.java
| @@ -8,12 +8,15 @@ import lombok.Getter; | @@ -8,12 +8,15 @@ import lombok.Getter; | ||
| 8 | import lombok.Setter; | 8 | import lombok.Setter; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | - * @TableName tax_pipeline_business_keyword | 11 | + * 管道业务关键词 |
| 12 | + * | ||
| 13 | + * @author zhangmeiyang | ||
| 14 | + * @date 2025/11/26 | ||
| 12 | */ | 15 | */ |
| 13 | -@TableName(value = "tax_pipeline_business_keyword") | 16 | +@TableName(value = "pipeline_business_keyword") |
| 14 | @Getter | 17 | @Getter |
| 15 | @Setter | 18 | @Setter |
| 16 | -public class TaxPipelineBusinessKeyword { | 19 | +public class PipelineBusinessKeyword { |
| 17 | /** | 20 | /** |
| 18 | * | 21 | * |
| 19 | */ | 22 | */ |
| @@ -24,7 +27,7 @@ public class TaxPipelineBusinessKeyword { | @@ -24,7 +27,7 @@ public class TaxPipelineBusinessKeyword { | ||
| 24 | * 业务id | 27 | * 业务id |
| 25 | */ | 28 | */ |
| 26 | @TableField(value = "tax_pipeline_business_id") | 29 | @TableField(value = "tax_pipeline_business_id") |
| 27 | - private Long taxPipelineBusinessId; | 30 | + private Long pipelineBusinessId; |
| 28 | 31 | ||
| 29 | /** | 32 | /** |
| 30 | * 单据类型 | 33 | * 单据类型 |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineFieldType.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineDocFieldType.java
| @@ -9,11 +9,13 @@ import lombok.Data; | @@ -9,11 +9,13 @@ import lombok.Data; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 账套字段配置表 | 11 | * 账套字段配置表 |
| 12 | - * @TableName tax_pipeline_field_type | 12 | + * |
| 13 | + * @author zhangmeiyang | ||
| 14 | + * @date 2025/11/26 | ||
| 13 | */ | 15 | */ |
| 14 | -@TableName(value ="tax_pipeline_field_type") | 16 | +@TableName(value ="pipeline_doc_field_type") |
| 15 | @Data | 17 | @Data |
| 16 | -public class TaxPipelineFieldType { | 18 | +public class PipelineDocFieldType { |
| 17 | /** | 19 | /** |
| 18 | * | 20 | * |
| 19 | */ | 21 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineDynamicConfig.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineDocFieldTypeDynamic.java
| @@ -9,13 +9,15 @@ import lombok.Data; | @@ -9,13 +9,15 @@ import lombok.Data; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 账套动态字段配置表 | 11 | * 账套动态字段配置表 |
| 12 | - * @TableName tax_pipeline_dynamic_config | 12 | + * |
| 13 | + * @author zhangmeiyang | ||
| 14 | + * @date 2025/11/26 | ||
| 13 | */ | 15 | */ |
| 14 | -@TableName(value ="tax_pipeline_dynamic_config") | 16 | +@TableName(value ="pipeline_doc_field_type_dynamic") |
| 15 | @Data | 17 | @Data |
| 16 | -public class TaxPipelineDynamicConfig { | 18 | +public class PipelineDocFieldTypeDynamic { |
| 17 | /** | 19 | /** |
| 18 | - * | 20 | + *id |
| 19 | */ | 21 | */ |
| 20 | @TableId(type = IdType.AUTO) | 22 | @TableId(type = IdType.AUTO) |
| 21 | private Long id; | 23 | private Long id; |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineFixedConfig.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineDocFieldTypeFixed.java
| @@ -11,11 +11,12 @@ import java.time.LocalDateTime; | @@ -11,11 +11,12 @@ import java.time.LocalDateTime; | ||
| 11 | /** | 11 | /** |
| 12 | * 账套默认配置表 | 12 | * 账套默认配置表 |
| 13 | * | 13 | * |
| 14 | - * @TableName tax_pipeline_fixed_config | 14 | + * @author zhangmeiyang |
| 15 | + * @date 2025/11/26 | ||
| 15 | */ | 16 | */ |
| 16 | -@TableName(value = "tax_pipeline_fixed_config") | 17 | +@TableName(value = "pipeline_doc_field_type_fixed") |
| 17 | @Data | 18 | @Data |
| 18 | -public class TaxPipelineFixedConfig { | 19 | +public class PipelineDocFieldTypeFixed { |
| 19 | /** | 20 | /** |
| 20 | * | 21 | * |
| 21 | */ | 22 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineRemoteConfig.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineDocFieldTypeRemote.java
| @@ -11,11 +11,12 @@ import java.time.LocalDateTime; | @@ -11,11 +11,12 @@ import java.time.LocalDateTime; | ||
| 11 | /** | 11 | /** |
| 12 | * 账套远程调用配置表 | 12 | * 账套远程调用配置表 |
| 13 | * | 13 | * |
| 14 | - * @TableName tax_pipeline_remote_config | 14 | + * @author zhangmeiyang |
| 15 | + * @date 2025/11/26 | ||
| 15 | */ | 16 | */ |
| 16 | -@TableName(value = "tax_pipeline_remote_config") | 17 | +@TableName(value = "pipeline_doc_field_type_remote") |
| 17 | @Data | 18 | @Data |
| 18 | -public class TaxPipelineRemoteConfig { | 19 | +public class PipelineDocFieldTypeRemote { |
| 19 | /** | 20 | /** |
| 20 | * | 21 | * |
| 21 | */ | 22 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineFieldVerify.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineDocValid.java
| @@ -9,11 +9,13 @@ import lombok.Data; | @@ -9,11 +9,13 @@ import lombok.Data; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 账套字段验证重复表 | 11 | * 账套字段验证重复表 |
| 12 | - * @TableName tax_pipeline_field_verify | 12 | + * |
| 13 | + * @author zhangmeiyang | ||
| 14 | + * @date 2025/11/26 | ||
| 13 | */ | 15 | */ |
| 14 | -@TableName(value ="tax_pipeline_field_verify") | 16 | +@TableName(value ="pipeline_doc_valid") |
| 15 | @Data | 17 | @Data |
| 16 | -public class TaxPipelineFieldVerify { | 18 | +public class PipelineDocValid { |
| 17 | /** | 19 | /** |
| 18 | * | 20 | * |
| 19 | */ | 21 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineFieldVerifyReturn.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineDocValidReturn.java
| @@ -9,11 +9,13 @@ import lombok.Data; | @@ -9,11 +9,13 @@ import lombok.Data; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 账套字段验证重复表 | 11 | * 账套字段验证重复表 |
| 12 | - * @TableName tax_pipeline_field_verify_return | 12 | + * |
| 13 | + * @author zhangmeiyang | ||
| 14 | + * @date 2025/11/26 | ||
| 13 | */ | 15 | */ |
| 14 | -@TableName(value ="tax_pipeline_field_verify_return") | 16 | +@TableName(value ="pipeline_doc_valid_return") |
| 15 | @Data | 17 | @Data |
| 16 | -public class TaxPipelineFieldVerifyReturn { | 18 | +public class PipelineDocValidReturn { |
| 17 | /** | 19 | /** |
| 18 | * | 20 | * |
| 19 | */ | 21 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineMapping.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/PipelineMapping.java
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineBusinessConfig.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.domain; | ||
| 2 | - | ||
| 3 | -import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | -import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | -import com.baomidou.mybatisplus.annotation.TableId; | ||
| 6 | -import com.baomidou.mybatisplus.annotation.TableName; | ||
| 7 | -import lombok.Data; | ||
| 8 | - | ||
| 9 | -import java.time.LocalDateTime; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 账套业务配置 | ||
| 13 | - * | ||
| 14 | - * @TableName tax_pipeline_business_config | ||
| 15 | - */ | ||
| 16 | -@TableName(value = "tax_pipeline_business_config") | ||
| 17 | -@Data | ||
| 18 | -public class TaxPipelineBusinessConfig { | ||
| 19 | - /** | ||
| 20 | - * | ||
| 21 | - */ | ||
| 22 | - @TableId(type = IdType.AUTO) | ||
| 23 | - private Long id; | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 业务ID | ||
| 27 | - */ | ||
| 28 | - @TableField(value = "tax_pipeline_business_id") | ||
| 29 | - private Long taxPipelineBusinessId; | ||
| 30 | - | ||
| 31 | - /** | ||
| 32 | - * 单据配置 | ||
| 33 | - */ | ||
| 34 | - @TableField(value = "document_type") | ||
| 35 | - private String documentType; | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 创建时间 | ||
| 39 | - */ | ||
| 40 | - @TableField(value = "created_time") | ||
| 41 | - private LocalDateTime createdTime; | ||
| 42 | - | ||
| 43 | - /** | ||
| 44 | - * 更新时间 | ||
| 45 | - */ | ||
| 46 | - @TableField(value = "modified_time") | ||
| 47 | - private LocalDateTime modifiedTime; | ||
| 48 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineBusinessExt.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.domain; | ||
| 2 | - | ||
| 3 | -import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | -import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | -import com.baomidou.mybatisplus.annotation.TableId; | ||
| 6 | -import com.baomidou.mybatisplus.annotation.TableName; | ||
| 7 | -import java.time.LocalDateTime; | ||
| 8 | -import lombok.Data; | ||
| 9 | - | ||
| 10 | -/** | ||
| 11 | - * 账套业务配置 | ||
| 12 | - * @TableName tax_pipeline_business_ext | ||
| 13 | - */ | ||
| 14 | -@TableName(value ="tax_pipeline_business_ext") | ||
| 15 | -@Data | ||
| 16 | -public class TaxPipelineBusinessExt { | ||
| 17 | - /** | ||
| 18 | - * | ||
| 19 | - */ | ||
| 20 | - @TableId(type = IdType.AUTO) | ||
| 21 | - private Long id; | ||
| 22 | - | ||
| 23 | - /** | ||
| 24 | - * 业务ID | ||
| 25 | - */ | ||
| 26 | - @TableField(value = "tax_pipeline_business_id") | ||
| 27 | - private Long taxPipelineBusinessId; | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 扩展名字 | ||
| 31 | - */ | ||
| 32 | - @TableField(value = "ext_name") | ||
| 33 | - private String extName; | ||
| 34 | - | ||
| 35 | - /** | ||
| 36 | - * 扩展编码 | ||
| 37 | - */ | ||
| 38 | - @TableField(value = "ext_code") | ||
| 39 | - private String extCode; | ||
| 40 | - | ||
| 41 | - /** | ||
| 42 | - * 扩展默认数据 | ||
| 43 | - */ | ||
| 44 | - @TableField(value = "ext_default_data") | ||
| 45 | - private String extDefaultData; | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 创建时间 | ||
| 49 | - */ | ||
| 50 | - @TableField(value = "created_time") | ||
| 51 | - private LocalDateTime createdTime; | ||
| 52 | - | ||
| 53 | - /** | ||
| 54 | - * 更新时间 | ||
| 55 | - */ | ||
| 56 | - @TableField(value = "modified_time") | ||
| 57 | - private LocalDateTime modifiedTime; | ||
| 58 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxPipelineBusinessExtData.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.domain; | ||
| 2 | - | ||
| 3 | -import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | -import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | -import com.baomidou.mybatisplus.annotation.TableId; | ||
| 6 | -import com.baomidou.mybatisplus.annotation.TableName; | ||
| 7 | -import lombok.Data; | ||
| 8 | - | ||
| 9 | -import java.time.LocalDateTime; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 账套业务扩展数据 | ||
| 13 | - * | ||
| 14 | - * @TableName tax_pipeline_business_ext_data | ||
| 15 | - */ | ||
| 16 | -@TableName(value = "tax_pipeline_business_ext_data") | ||
| 17 | -@Data | ||
| 18 | -public class TaxPipelineBusinessExtData { | ||
| 19 | - /** | ||
| 20 | - * | ||
| 21 | - */ | ||
| 22 | - @TableId(type = IdType.AUTO) | ||
| 23 | - private Long id; | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 业务扩展表ID | ||
| 27 | - */ | ||
| 28 | - @TableField(value = "tax_pipeline_business_ext_id") | ||
| 29 | - private Long taxPipelineBusinessExtId; | ||
| 30 | - | ||
| 31 | - /** | ||
| 32 | - * 扩展数据 | ||
| 33 | - */ | ||
| 34 | - @TableField(value = "ext_data") | ||
| 35 | - private String extData; | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 创建时间 | ||
| 39 | - */ | ||
| 40 | - @TableField(value = "created_time") | ||
| 41 | - private LocalDateTime createdTime; | ||
| 42 | - | ||
| 43 | - /** | ||
| 44 | - * 更新时间 | ||
| 45 | - */ | ||
| 46 | - @TableField(value = "modified_time") | ||
| 47 | - private LocalDateTime modifiedTime; | ||
| 48 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/domain/TaxTenant.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/domain/Tenant.java
| @@ -11,8 +11,8 @@ import java.time.LocalDateTime; | @@ -11,8 +11,8 @@ import java.time.LocalDateTime; | ||
| 11 | 11 | ||
| 12 | @Getter | 12 | @Getter |
| 13 | @Setter | 13 | @Setter |
| 14 | -@TableName(value = "tax_tenant") | ||
| 15 | -public class TaxTenant { | 14 | +@TableName(value = "tenant") |
| 15 | +public class Tenant { | ||
| 16 | @TableId(type = IdType.AUTO) | 16 | @TableId(type = IdType.AUTO) |
| 17 | private Long id; | 17 | private Long id; |
| 18 | 18 |
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineBusinessCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineBusinessCO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineBusinessKeywordCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineBusinessKeywordCO.java
| @@ -13,14 +13,17 @@ import lombok.Setter; | @@ -13,14 +13,17 @@ import lombok.Setter; | ||
| 13 | */ | 13 | */ |
| 14 | @Getter | 14 | @Getter |
| 15 | @Setter | 15 | @Setter |
| 16 | -public class TaxPipelineBusinessKeywordCO { | 16 | +public class PipelineBusinessKeywordCO { |
| 17 | 17 | ||
| 18 | + /** | ||
| 19 | + * id | ||
| 20 | + */ | ||
| 18 | private Integer id; | 21 | private Integer id; |
| 19 | /** | 22 | /** |
| 20 | * 业务id | 23 | * 业务id |
| 21 | */ | 24 | */ |
| 22 | @NotNull(groups = {Valid.Create.class, Valid.Read.class}) | 25 | @NotNull(groups = {Valid.Create.class, Valid.Read.class}) |
| 23 | - private Long taxPipelineBusinessId; | 26 | + private Long pipelineBusinessId; |
| 24 | /** | 27 | /** |
| 25 | * 单据类型 | 28 | * 单据类型 |
| 26 | */ | 29 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineCO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineFieldConfigCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineDocFieldTypeCO.java
| 1 | package com.diligrp.tax.storage.model.co; | 1 | package com.diligrp.tax.storage.model.co; |
| 2 | 2 | ||
| 3 | import com.diligrp.tax.central.message.Valid; | 3 | import com.diligrp.tax.central.message.Valid; |
| 4 | -import com.diligrp.tax.central.model.DynamicValue; | ||
| 5 | -import com.diligrp.tax.central.model.RemoteParam; | 4 | +import com.diligrp.tax.central.model.DynamicValueDO; |
| 5 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeRemoteParamDO; | ||
| 6 | import jakarta.validation.constraints.NotEmpty; | 6 | import jakarta.validation.constraints.NotEmpty; |
| 7 | import jakarta.validation.constraints.NotNull; | 7 | import jakarta.validation.constraints.NotNull; |
| 8 | import lombok.Getter; | 8 | import lombok.Getter; |
| @@ -17,7 +17,7 @@ import java.util.List; | @@ -17,7 +17,7 @@ import java.util.List; | ||
| 17 | */ | 17 | */ |
| 18 | @Getter | 18 | @Getter |
| 19 | @Setter | 19 | @Setter |
| 20 | -public class TaxPipelineFieldConfigCO { | 20 | +public class PipelineDocFieldTypeCO { |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| 23 | * 管道 ID | 23 | * 管道 ID |
| @@ -30,8 +30,6 @@ public class TaxPipelineFieldConfigCO { | @@ -30,8 +30,6 @@ public class TaxPipelineFieldConfigCO { | ||
| 30 | */ | 30 | */ |
| 31 | @NotEmpty(groups = {Valid.Create.class}) | 31 | @NotEmpty(groups = {Valid.Create.class}) |
| 32 | private String documentType; | 32 | private String documentType; |
| 33 | - | ||
| 34 | - | ||
| 35 | /** | 33 | /** |
| 36 | * 配置键 | 34 | * 配置键 |
| 37 | */ | 35 | */ |
| @@ -52,10 +50,10 @@ public class TaxPipelineFieldConfigCO { | @@ -52,10 +50,10 @@ public class TaxPipelineFieldConfigCO { | ||
| 52 | /** | 50 | /** |
| 53 | * 动态值 | 51 | * 动态值 |
| 54 | */ | 52 | */ |
| 55 | - private List<DynamicValue> dynamicValues; | 53 | + private List<DynamicValueDO> dynamicValueDOS; |
| 56 | 54 | ||
| 57 | /** | 55 | /** |
| 58 | * 远程参数 | 56 | * 远程参数 |
| 59 | */ | 57 | */ |
| 60 | - private RemoteParam remoteParam; | 58 | + private PipelineDocFieldTypeRemoteParamDO pipelineDocFieldTypeRemoteParamDO; |
| 61 | } | 59 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineFieldVerifyCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineDocValidCO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineFieldVerifyReturnCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineDocValidReturnCO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineMappingCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineMappingCO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxPipelineMappingCreateCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/PipelineMappingCreateCO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TaxTenantCO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/co/TenantCO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineBusinessKeywordVO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/PipelineBusinessKeywordVO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineBusinessVO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/PipelineBusinessVO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineFieldVerifyReturnVO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/PipelineDocFieldTypeValidReturnVO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineFieldVerifyVO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/PipelineDocFieldTypeValidVO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxPipelineVO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/PipelineVO.java
tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TaxTenantVO.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/model/vo/TenantVO.java
| @@ -3,7 +3,6 @@ package com.diligrp.tax.storage.model.vo; | @@ -3,7 +3,6 @@ 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 | 7 | ||
| 9 | /** | 8 | /** |
| @@ -13,7 +12,7 @@ import java.time.LocalDateTime; | @@ -13,7 +12,7 @@ import java.time.LocalDateTime; | ||
| 13 | */ | 12 | */ |
| 14 | @Getter | 13 | @Getter |
| 15 | @Setter | 14 | @Setter |
| 16 | -public class TaxTenantVO { | 15 | +public class TenantVO { |
| 17 | /** | 16 | /** |
| 18 | * id | 17 | * id |
| 19 | */ | 18 | */ |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxMappingErrorRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/MappingErrorRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 4 | -import com.diligrp.tax.storage.domain.TaxMappingError; | 4 | +import com.diligrp.tax.storage.domain.MappingError; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| 7 | @Repository | 7 | @Repository |
| 8 | -public interface TaxMappingErrorRepository extends BaseMapper<TaxMappingError> { | 8 | +public interface MappingErrorRepository extends BaseMapper<MappingError> { |
| 9 | } | 9 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineBusinessKeywordRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineBusinessKeywordRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 4 | -import com.diligrp.tax.storage.domain.TaxPipelineBusinessKeyword; | 4 | +import com.diligrp.tax.storage.domain.PipelineBusinessKeyword; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | ||
| 11 | * @Entity com.diligrp.tax.storge.domain.TaxPipelineBusinessKeyword | 11 | * @Entity com.diligrp.tax.storge.domain.TaxPipelineBusinessKeyword |
| 12 | */ | 12 | */ |
| 13 | @Repository | 13 | @Repository |
| 14 | -public interface TaxPipelineBusinessKeywordRepository extends BaseMapper<TaxPipelineBusinessKeyword> { | 14 | +public interface PipelineBusinessKeywordRepository extends BaseMapper<PipelineBusinessKeyword> { |
| 15 | 15 | ||
| 16 | } | 16 | } |
| 17 | 17 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineBusinessRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineBusinessRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.storage.domain.TaxPipelineBusiness; | 3 | +import com.diligrp.tax.storage.domain.PipelineBusiness; |
| 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 9 | * @createDate 2025-11-13 14:58:05 | 9 | * @createDate 2025-11-13 14:58:05 |
| 10 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineBusiness | 10 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineBusiness |
| 11 | */ | 11 | */ |
| 12 | -public interface TaxPipelineBusinessRepository extends BaseMapper<TaxPipelineBusiness> { | 12 | +public interface PipelineBusinessRepository extends BaseMapper<PipelineBusiness> { |
| 13 | 13 | ||
| 14 | } | 14 | } |
| 15 | 15 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineDynamicConfigRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineDocFieldTypeDynamicRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.storage.domain.TaxPipelineDynamicConfig; | 3 | +import com.diligrp.tax.storage.domain.PipelineDocFieldTypeDynamic; |
| 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | ||
| 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineDynamicConfig | 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineDynamicConfig |
| 12 | */ | 12 | */ |
| 13 | @Repository | 13 | @Repository |
| 14 | -public interface TaxPipelineDynamicConfigRepository extends BaseMapper<TaxPipelineDynamicConfig> { | 14 | +public interface PipelineDocFieldTypeDynamicRepository extends BaseMapper<PipelineDocFieldTypeDynamic> { |
| 15 | 15 | ||
| 16 | } | 16 | } |
| 17 | 17 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineFixedConfigRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineDocFieldTypeFixedRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.storage.domain.TaxPipelineFixedConfig; | 3 | +import com.diligrp.tax.storage.domain.PipelineDocFieldTypeFixed; |
| 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | ||
| 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFixedConfig | 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFixedConfig |
| 12 | */ | 12 | */ |
| 13 | @Repository | 13 | @Repository |
| 14 | -public interface TaxPipelineFixedConfigRepository extends BaseMapper<TaxPipelineFixedConfig> { | 14 | +public interface PipelineDocFieldTypeFixedRepository extends BaseMapper<PipelineDocFieldTypeFixed> { |
| 15 | 15 | ||
| 16 | } | 16 | } |
| 17 | 17 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineRemoteConfigRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineDocFieldTypeRemoteRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 4 | -import com.diligrp.tax.storage.domain.TaxPipelineRemoteConfig; | 4 | +import com.diligrp.tax.storage.domain.PipelineDocFieldTypeRemote; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | ||
| 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineRemoteConfig | 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineRemoteConfig |
| 12 | */ | 12 | */ |
| 13 | @Repository | 13 | @Repository |
| 14 | -public interface TaxPipelineRemoteConfigRepository extends BaseMapper<TaxPipelineRemoteConfig> { | 14 | +public interface PipelineDocFieldTypeRemoteRepository extends BaseMapper<PipelineDocFieldTypeRemote> { |
| 15 | 15 | ||
| 16 | } | 16 | } |
| 17 | 17 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineFieldTypeRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineDocFieldTypeRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.storage.domain.TaxPipelineFieldType; | 3 | +import com.diligrp.tax.storage.domain.PipelineDocFieldType; |
| 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 9 | * @createDate 2025-11-10 18:40:44 | 9 | * @createDate 2025-11-10 18:40:44 |
| 10 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFieldType | 10 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFieldType |
| 11 | */ | 11 | */ |
| 12 | -public interface TaxPipelineFieldTypeRepository extends BaseMapper<TaxPipelineFieldType> { | 12 | +public interface PipelineDocFieldTypeRepository extends BaseMapper<PipelineDocFieldType> { |
| 13 | 13 | ||
| 14 | } | 14 | } |
| 15 | 15 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineFieldVerifyRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineDocValidRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.storage.domain.TaxPipelineFieldVerify; | 3 | +import com.diligrp.tax.storage.domain.PipelineDocValid; |
| 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | ||
| 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFieldVerify | 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFieldVerify |
| 12 | */ | 12 | */ |
| 13 | @Repository | 13 | @Repository |
| 14 | -public interface TaxPipelineFieldVerifyRepository extends BaseMapper<TaxPipelineFieldVerify> { | 14 | +public interface PipelineDocValidRepository extends BaseMapper<PipelineDocValid> { |
| 15 | 15 | ||
| 16 | } | 16 | } |
| 17 | 17 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineFieldVerifyReturnRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineDocValidReturnRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.storage.domain.TaxPipelineFieldVerifyReturn; | 3 | +import com.diligrp.tax.storage.domain.PipelineDocValidReturn; |
| 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | @@ -11,7 +11,7 @@ import org.springframework.stereotype.Repository; | ||
| 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFieldVerifyReturn | 11 | * @Entity com.diligrp.tax.storage.domain.TaxPipelineFieldVerifyReturn |
| 12 | */ | 12 | */ |
| 13 | @Repository | 13 | @Repository |
| 14 | -public interface TaxPipelineFieldVerifyReturnRepository extends BaseMapper<TaxPipelineFieldVerifyReturn> { | 14 | +public interface PipelineDocValidReturnRepository extends BaseMapper<PipelineDocValidReturn> { |
| 15 | 15 | ||
| 16 | } | 16 | } |
| 17 | 17 |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineMappingRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineMappingRepository.java
| @@ -2,8 +2,7 @@ package com.diligrp.tax.storage.repo; | @@ -2,8 +2,7 @@ package com.diligrp.tax.storage.repo; | ||
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.metadata.IPage; | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 5 | -import com.diligrp.tax.storage.domain.TaxPipelineMapping; | ||
| 6 | -import com.diligrp.tax.central.model.TenantTaxPipelineMapping; | 5 | +import com.diligrp.tax.central.model.PipelineMappingDO; |
| 7 | import org.apache.ibatis.annotations.Param; | 6 | import org.apache.ibatis.annotations.Param; |
| 8 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; |
| 9 | 8 | ||
| @@ -11,45 +10,45 @@ import java.util.List; | @@ -11,45 +10,45 @@ import java.util.List; | ||
| 11 | import java.util.Optional; | 10 | import java.util.Optional; |
| 12 | 11 | ||
| 13 | @Repository | 12 | @Repository |
| 14 | -public interface TaxPipelineMappingRepository { | 13 | +public interface PipelineMappingRepository { |
| 15 | 14 | ||
| 16 | /** | 15 | /** |
| 17 | * 插入 | 16 | * 插入 |
| 18 | * | 17 | * |
| 19 | * @param mapping 税务管道映射 | 18 | * @param mapping 税务管道映射 |
| 20 | */ | 19 | */ |
| 21 | - void insert(TaxPipelineMapping mapping); | 20 | + void insert(com.diligrp.tax.storage.domain.PipelineMapping mapping); |
| 22 | 21 | ||
| 23 | /** | 22 | /** |
| 24 | * 更新 | 23 | * 更新 |
| 25 | * | 24 | * |
| 26 | * @param mapping 税务管道映射 | 25 | * @param mapping 税务管道映射 |
| 27 | */ | 26 | */ |
| 28 | - void updateStatus(TaxPipelineMapping mapping); | 27 | + void updateStatus(com.diligrp.tax.storage.domain.PipelineMapping mapping); |
| 29 | 28 | ||
| 30 | /** | 29 | /** |
| 31 | * 按管道 ID 查找 | 30 | * 按管道 ID 查找 |
| 32 | * | 31 | * |
| 33 | * @param mapping 税务管道映射 | 32 | * @param mapping 税务管道映射 |
| 34 | - * @return {@link List }<{@link TaxPipelineMapping }> | 33 | + * @return {@link List }<{@link com.diligrp.tax.storage.domain.PipelineMapping }> |
| 35 | */ | 34 | */ |
| 36 | - Page<TenantTaxPipelineMapping> findByPipelineIdAndState(TaxPipelineMapping mapping, IPage<?> page); | 35 | + Page<PipelineMappingDO> findByPipelineIdAndState(com.diligrp.tax.storage.domain.PipelineMapping mapping, IPage<?> page); |
| 37 | 36 | ||
| 38 | /** | 37 | /** |
| 39 | * 按管道 ID 和系统数据 ID 查找 | 38 | * 按管道 ID 和系统数据 ID 查找 |
| 40 | * | 39 | * |
| 41 | * @param mapping 映射 | 40 | * @param mapping 映射 |
| 42 | - * @return {@link Optional }<{@link TaxPipelineMapping }> | 41 | + * @return {@link Optional }<{@link com.diligrp.tax.storage.domain.PipelineMapping }> |
| 43 | */ | 42 | */ |
| 44 | - Optional<TenantTaxPipelineMapping> findByPipelineIdAndDocumentTypeAndSystemDataId(TaxPipelineMapping mapping); | 43 | + Optional<PipelineMappingDO> findByPipelineIdAndDocumentTypeAndSystemDataId(com.diligrp.tax.storage.domain.PipelineMapping mapping); |
| 45 | 44 | ||
| 46 | /** | 45 | /** |
| 47 | * 通过管道ID、文档类型以及系统数据ID和管道数据ID查找 | 46 | * 通过管道ID、文档类型以及系统数据ID和管道数据ID查找 |
| 48 | * | 47 | * |
| 49 | - * @param taxPipelineMapping 税收管道映射 | ||
| 50 | - * @return {@link Optional }<{@link TenantTaxPipelineMapping }> | 48 | + * @param pipelineMapping 税收管道映射 |
| 49 | + * @return {@link Optional }<{@link PipelineMappingDO }> | ||
| 51 | */ | 50 | */ |
| 52 | - Optional<TenantTaxPipelineMapping> findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(TaxPipelineMapping taxPipelineMapping); | 51 | + Optional<PipelineMappingDO> findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(com.diligrp.tax.storage.domain.PipelineMapping pipelineMapping); |
| 53 | 52 | ||
| 54 | 53 | ||
| 55 | /** | 54 | /** |
| @@ -69,8 +68,8 @@ public interface TaxPipelineMappingRepository { | @@ -69,8 +68,8 @@ public interface TaxPipelineMappingRepository { | ||
| 69 | /** | 68 | /** |
| 70 | * 更新 | 69 | * 更新 |
| 71 | * | 70 | * |
| 72 | - * @param taxPipelineMapping 税务管道映射 | 71 | + * @param pipelineMapping 税务管道映射 |
| 73 | */ | 72 | */ |
| 74 | - void update(TaxPipelineMapping taxPipelineMapping); | 73 | + void update(com.diligrp.tax.storage.domain.PipelineMapping pipelineMapping); |
| 75 | 74 | ||
| 76 | } | 75 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxPipelineRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/PipelineRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 4 | -import com.diligrp.tax.storage.domain.TaxPipeline; | 4 | +import com.diligrp.tax.storage.domain.Pipeline; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| 7 | @Repository | 7 | @Repository |
| 8 | -public interface TaxPipelineRepository extends BaseMapper<TaxPipeline> { | 8 | +public interface PipelineRepository extends BaseMapper<Pipeline> { |
| 9 | 9 | ||
| 10 | } | 10 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/repo/TaxTenantRepository.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/repo/TenantRepository.java
| 1 | package com.diligrp.tax.storage.repo; | 1 | package com.diligrp.tax.storage.repo; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 4 | -import com.diligrp.tax.storage.domain.TaxTenant; | 4 | +import com.diligrp.tax.storage.domain.Tenant; |
| 5 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| @@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository; | @@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository; | ||
| 10 | * @Version: todo | 10 | * @Version: todo |
| 11 | */ | 11 | */ |
| 12 | @Repository | 12 | @Repository |
| 13 | -public interface TaxTenantRepository extends BaseMapper<TaxTenant> { | 13 | +public interface TenantRepository extends BaseMapper<Tenant> { |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | } | 16 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/service/TaxMappingErrorService.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/service/MappingErrorService.java
| 1 | package com.diligrp.tax.storage.service; | 1 | package com.diligrp.tax.storage.service; |
| 2 | 2 | ||
| 3 | -import com.diligrp.tax.central.model.TaxPipelineMappingError; | ||
| 4 | -import com.diligrp.tax.central.service.ITaxMappingErrorService; | 3 | +import com.diligrp.tax.central.model.PipelineMappingErrorDO; |
| 4 | +import com.diligrp.tax.central.service.IMappingErrorService; | ||
| 5 | import com.diligrp.tax.central.utils.JsonUtils; | 5 | import com.diligrp.tax.central.utils.JsonUtils; |
| 6 | -import com.diligrp.tax.storage.domain.TaxMappingError; | ||
| 7 | -import com.diligrp.tax.storage.repo.TaxMappingErrorRepository; | 6 | +import com.diligrp.tax.storage.domain.MappingError; |
| 7 | +import com.diligrp.tax.storage.repo.MappingErrorRepository; | ||
| 8 | import jakarta.annotation.Resource; | 8 | import jakarta.annotation.Resource; |
| 9 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 10 | 10 | ||
| @@ -14,10 +14,10 @@ import org.springframework.stereotype.Service; | @@ -14,10 +14,10 @@ import org.springframework.stereotype.Service; | ||
| 14 | * @Version: todo | 14 | * @Version: todo |
| 15 | */ | 15 | */ |
| 16 | @Service | 16 | @Service |
| 17 | -public class TaxMappingErrorService implements ITaxMappingErrorService { | 17 | +public class MappingErrorService implements IMappingErrorService { |
| 18 | 18 | ||
| 19 | @Resource | 19 | @Resource |
| 20 | - private TaxMappingErrorRepository taxMappingErrorRepository; | 20 | + private MappingErrorRepository mappingErrorRepository; |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| 23 | * 插入 | 23 | * 插入 |
| @@ -25,8 +25,8 @@ public class TaxMappingErrorService implements ITaxMappingErrorService { | @@ -25,8 +25,8 @@ public class TaxMappingErrorService implements ITaxMappingErrorService { | ||
| 25 | * @param error 错误 | 25 | * @param error 错误 |
| 26 | */ | 26 | */ |
| 27 | @Override | 27 | @Override |
| 28 | - public void insert(TaxPipelineMappingError error) { | ||
| 29 | - TaxMappingError save = JsonUtils.convertValue(error, TaxMappingError.class); | ||
| 30 | - taxMappingErrorRepository.insert(save); | 28 | + public void insert(PipelineMappingErrorDO error) { |
| 29 | + MappingError save = JsonUtils.convertValue(error, MappingError.class); | ||
| 30 | + mappingErrorRepository.insert(save); | ||
| 31 | } | 31 | } |
| 32 | } | 32 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/service/PipelineBusinessService.java
0 → 100644
| 1 | +package com.diligrp.tax.storage.service; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 7 | +import com.diligrp.tax.central.model.PipelineBusinessKeywordDO; | ||
| 8 | +import com.diligrp.tax.central.service.IPipelineBusinessKeywordService; | ||
| 9 | +import com.diligrp.tax.central.type.DocumentFieldType; | ||
| 10 | +import com.diligrp.tax.central.type.DocumentType; | ||
| 11 | +import com.diligrp.tax.central.type.DocumentValueWayType; | ||
| 12 | +import com.diligrp.tax.central.type.TaxSystemType; | ||
| 13 | +import com.diligrp.tax.central.utils.JsonUtils; | ||
| 14 | +import com.diligrp.tax.storage.domain.PipelineBusiness; | ||
| 15 | +import com.diligrp.tax.storage.domain.PipelineBusinessKeyword; | ||
| 16 | +import com.diligrp.tax.storage.model.co.PipelineBusinessCO; | ||
| 17 | +import com.diligrp.tax.storage.model.co.PipelineBusinessKeywordCO; | ||
| 18 | +import com.diligrp.tax.storage.model.vo.PipelineBusinessKeywordVO; | ||
| 19 | +import com.diligrp.tax.storage.model.vo.PipelineBusinessVO; | ||
| 20 | +import com.diligrp.tax.storage.model.vo.PipelineVO; | ||
| 21 | +import com.diligrp.tax.storage.repo.PipelineBusinessKeywordRepository; | ||
| 22 | +import com.diligrp.tax.storage.repo.PipelineBusinessRepository; | ||
| 23 | +import jakarta.annotation.Resource; | ||
| 24 | +import org.springframework.stereotype.Service; | ||
| 25 | +import org.springframework.transaction.annotation.Transactional; | ||
| 26 | + | ||
| 27 | +import java.util.List; | ||
| 28 | +import java.util.Optional; | ||
| 29 | + | ||
| 30 | +/** | ||
| 31 | + * @Author: zhangmeiyang | ||
| 32 | + * @CreateTime: 2025-11-13 15:15 | ||
| 33 | + * @Version: todo | ||
| 34 | + */ | ||
| 35 | +@Service | ||
| 36 | +public class PipelineBusinessService implements IPipelineBusinessKeywordService { | ||
| 37 | + @Resource | ||
| 38 | + private PipelineBusinessRepository pipelineBusinessRepository; | ||
| 39 | + @Resource | ||
| 40 | + private PipelineBusinessKeywordRepository pipelineBusinessKeywordRepository; | ||
| 41 | + @Resource | ||
| 42 | + private TenantService tenantService; | ||
| 43 | + @Resource | ||
| 44 | + private PipelineService pipelineService; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 保存业务类型 | ||
| 48 | + * | ||
| 49 | + * @param co 公司 | ||
| 50 | + */ | ||
| 51 | + @Transactional | ||
| 52 | + public void saveBusiness(PipelineBusinessCO co) { | ||
| 53 | + LambdaQueryWrapper<PipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 54 | + queryWrapper.eq(PipelineBusiness::getPipelineId, co.getPipelineId()); | ||
| 55 | + queryWrapper.eq(PipelineBusiness::getBusinessCode, co.getBusinessCode()); | ||
| 56 | + Optional.ofNullable(pipelineBusinessRepository.selectOne(queryWrapper)).ifPresent(pipelineBusiness -> { | ||
| 57 | + throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "业务编码重复"); | ||
| 58 | + }); | ||
| 59 | + pipelineBusinessRepository.insert(JsonUtils.convertValue(co, PipelineBusiness.class)); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 更新业务 | ||
| 64 | + * | ||
| 65 | + * @param co 公司 | ||
| 66 | + */ | ||
| 67 | + @Transactional | ||
| 68 | + public void updateBusiness(PipelineBusinessCO co) { | ||
| 69 | + LambdaQueryWrapper<PipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 70 | + queryWrapper.eq(PipelineBusiness::getPipelineId, co.getPipelineId()); | ||
| 71 | + queryWrapper.eq(PipelineBusiness::getBusinessCode, co.getBusinessCode()); | ||
| 72 | + Optional.ofNullable(pipelineBusinessRepository.selectOne(queryWrapper)).ifPresent(pipelineBusiness -> { | ||
| 73 | + throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "业务编码重复"); | ||
| 74 | + }); | ||
| 75 | + pipelineBusinessRepository.updateById(JsonUtils.convertValue(co, PipelineBusiness.class)); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + /** | ||
| 79 | + * 删除业务 | ||
| 80 | + * | ||
| 81 | + * @param id id | ||
| 82 | + */ | ||
| 83 | + @Transactional | ||
| 84 | + public void deleteBusiness(Long id) { | ||
| 85 | + pipelineBusinessRepository.deleteById(id); | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * 分页查询账套内业务 | ||
| 90 | + * | ||
| 91 | + * @param co 公司 | ||
| 92 | + * @return {@link IPage }<{@link PipelineBusinessVO }> | ||
| 93 | + */ | ||
| 94 | + public IPage<PipelineBusinessVO> pageBusiness(PipelineBusinessCO co) { | ||
| 95 | + LambdaQueryWrapper<PipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 96 | + queryWrapper.eq(PipelineBusiness::getPipelineId, co.getPipelineId()); | ||
| 97 | + Page<PipelineBusiness> page = pipelineBusinessRepository.selectPage(Page.of(co.getPageNumber(), co.getPageSize()), queryWrapper); | ||
| 98 | + return page.convert(item -> JsonUtils.convertValue(item, PipelineBusinessVO.class)); | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + /** | ||
| 102 | + * 批量保存业务关键字 | ||
| 103 | + * | ||
| 104 | + * @param cos 因为 | ||
| 105 | + */ | ||
| 106 | + @Transactional | ||
| 107 | + public void batchSaveBusinessKeyword(List<PipelineBusinessKeywordCO> cos) { | ||
| 108 | + Optional.ofNullable(cos).ifPresent(ts -> { | ||
| 109 | + Long taxPipelineBusinessId = ts.getFirst().getPipelineBusinessId(); | ||
| 110 | + LambdaQueryWrapper<PipelineBusinessKeyword> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 111 | + queryWrapper.eq(PipelineBusinessKeyword::getPipelineBusinessId, taxPipelineBusinessId); | ||
| 112 | + pipelineBusinessKeywordRepository.delete(queryWrapper); | ||
| 113 | + ts.forEach(co -> { | ||
| 114 | + DocumentType.validateDocumentType(co.getDocumentType()); | ||
| 115 | + PipelineBusinessKeyword pipelineBusinessKeyword = JsonUtils.convertValue(co, PipelineBusinessKeyword.class); | ||
| 116 | + pipelineBusinessKeywordRepository.insert(pipelineBusinessKeyword); | ||
| 117 | + }); | ||
| 118 | + }); | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + /** | ||
| 122 | + * 列表业务关键字 | ||
| 123 | + * | ||
| 124 | + * @param co 公司 | ||
| 125 | + * @return {@link List }<{@link PipelineBusinessKeywordVO }> | ||
| 126 | + */ | ||
| 127 | + public List<PipelineBusinessKeywordVO> listBusinessKeyword(PipelineBusinessKeywordCO co) { | ||
| 128 | + LambdaQueryWrapper<PipelineBusinessKeyword> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 129 | + queryWrapper.eq(PipelineBusinessKeyword::getPipelineBusinessId, co.getPipelineBusinessId()); | ||
| 130 | + return pipelineBusinessKeywordRepository.selectList(queryWrapper).stream().map(item -> JsonUtils.convertValue(item, PipelineBusinessKeywordVO.class)).toList(); | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + | ||
| 134 | + /** | ||
| 135 | + * 按租户、管道和业务查询 | ||
| 136 | + * | ||
| 137 | + * @param group 群 | ||
| 138 | + * @param entity 实体 | ||
| 139 | + * @param pipelineCode 管道代码 | ||
| 140 | + * @param businessCode 业务代码 | ||
| 141 | + * @return {@link List }<{@link PipelineBusinessKeywordDO }> | ||
| 142 | + */ | ||
| 143 | + @Override | ||
| 144 | + public List<PipelineBusinessKeywordDO> queryByTenantAndPipelineAndBusiness(String group, String entity, String pipelineCode, String businessCode, String documentType) { | ||
| 145 | + Long tenantId = tenantService.getTenantId(group, entity); | ||
| 146 | + PipelineVO byTenantIdAndCode = pipelineService.getByTenantIdAndCode(tenantId, pipelineCode); | ||
| 147 | + LambdaQueryWrapper<PipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 148 | + queryWrapper.eq(PipelineBusiness::getPipelineId, byTenantIdAndCode.getId()); | ||
| 149 | + queryWrapper.eq(PipelineBusiness::getBusinessCode, businessCode); | ||
| 150 | + PipelineBusiness pipelineBusiness = pipelineBusinessRepository.selectOne(queryWrapper); | ||
| 151 | + Optional.ofNullable(pipelineBusiness).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION)); | ||
| 152 | + LambdaQueryWrapper<PipelineBusinessKeyword> wrapper = new LambdaQueryWrapper<>(); | ||
| 153 | + wrapper.eq(PipelineBusinessKeyword::getPipelineBusinessId, pipelineBusiness.getId()); | ||
| 154 | + wrapper.eq(PipelineBusinessKeyword::getDocumentType, documentType); | ||
| 155 | + return pipelineBusinessKeywordRepository.selectList(wrapper).stream().map(item -> { | ||
| 156 | + PipelineBusinessKeywordDO pipelineBusinessKeywordDO = JsonUtils.convertValue(item, PipelineBusinessKeywordDO.class); | ||
| 157 | + pipelineBusinessKeywordDO.setDocumentFieldTypeEnum(DocumentFieldType.from(item.getDocumentFieldType())); | ||
| 158 | + pipelineBusinessKeywordDO.setDocumentValueWayTypeEnum(DocumentValueWayType.from(item.getDocumentValueWay())); | ||
| 159 | + return pipelineBusinessKeywordDO; | ||
| 160 | + }).toList(); | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + public void saveBusinessKeyword(PipelineBusinessKeywordCO co) { | ||
| 164 | + DocumentType.validateDocumentType(co.getDocumentType()); | ||
| 165 | + PipelineBusinessKeyword pipelineBusinessKeyword = JsonUtils.convertValue(co, PipelineBusinessKeyword.class); | ||
| 166 | + pipelineBusinessKeywordRepository.insert(pipelineBusinessKeyword); | ||
| 167 | + } | ||
| 168 | +} |
tax-storage/src/main/java/com/diligrp/tax/storage/service/PipelineDocFieldTypeService.java
0 → 100644
| 1 | +package com.diligrp.tax.storage.service; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 5 | +import com.diligrp.tax.central.model.DynamicValueDO; | ||
| 6 | +import com.diligrp.tax.central.model.OptionDO; | ||
| 7 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeDO; | ||
| 8 | +import com.diligrp.tax.central.model.PipelineDocFieldTypeRemoteParamDO; | ||
| 9 | +import com.diligrp.tax.central.type.DocumentType; | ||
| 10 | +import com.diligrp.tax.central.type.SettingFieldType; | ||
| 11 | +import com.diligrp.tax.central.type.SystemType; | ||
| 12 | +import com.diligrp.tax.central.type.TaxSystemType; | ||
| 13 | +import com.diligrp.tax.storage.domain.PipelineDocFieldType; | ||
| 14 | +import com.diligrp.tax.storage.domain.PipelineDocFieldTypeDynamic; | ||
| 15 | +import com.diligrp.tax.storage.domain.PipelineDocFieldTypeFixed; | ||
| 16 | +import com.diligrp.tax.storage.domain.PipelineDocFieldTypeRemote; | ||
| 17 | +import com.diligrp.tax.storage.model.co.PipelineDocFieldTypeCO; | ||
| 18 | +import com.diligrp.tax.storage.repo.PipelineDocFieldTypeDynamicRepository; | ||
| 19 | +import com.diligrp.tax.storage.repo.PipelineDocFieldTypeFixedRepository; | ||
| 20 | +import com.diligrp.tax.storage.repo.PipelineDocFieldTypeRemoteRepository; | ||
| 21 | +import com.diligrp.tax.storage.repo.PipelineDocFieldTypeRepository; | ||
| 22 | +import jakarta.annotation.Resource; | ||
| 23 | +import org.springframework.stereotype.Service; | ||
| 24 | +import org.springframework.transaction.annotation.Transactional; | ||
| 25 | + | ||
| 26 | +import java.util.List; | ||
| 27 | +import java.util.Map; | ||
| 28 | +import java.util.Optional; | ||
| 29 | +import java.util.stream.Collectors; | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * @Author: zhangmeiyang | ||
| 33 | + * @CreateTime: 2025-11-10 17:59 | ||
| 34 | + * @Version: todo | ||
| 35 | + */ | ||
| 36 | +@Service | ||
| 37 | +public class PipelineDocFieldTypeService { | ||
| 38 | + | ||
| 39 | + @Resource | ||
| 40 | + private PipelineDocFieldTypeRepository pipelineDocFieldTypeRepository; | ||
| 41 | + @Resource | ||
| 42 | + private PipelineDocFieldTypeRemoteRepository pipelineDocFieldTypeRemoteRepository; | ||
| 43 | + @Resource | ||
| 44 | + private PipelineDocFieldTypeFixedRepository pipelineDocFieldTypeFixedRepository; | ||
| 45 | + @Resource | ||
| 46 | + private PipelineDocFieldTypeDynamicRepository pipelineDocFieldTypeDynamicRepository; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 按系统类型列出文档 | ||
| 50 | + * | ||
| 51 | + * @param systemType 系统类型 | ||
| 52 | + * @return {@link List }<{@link OptionDO }> | ||
| 53 | + */ | ||
| 54 | + public List<OptionDO> listDocumentBySystemType(String systemType) { | ||
| 55 | + SystemType from = SystemType.from(systemType); | ||
| 56 | + return from.documentTypes.stream().map(documentType -> new OptionDO(documentType.desc, documentType.value)).toList(); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 按系统类型和文档类型列出字段 | ||
| 61 | + * | ||
| 62 | + * @param systemType 系统类型 | ||
| 63 | + * @param documentType 文档类型 | ||
| 64 | + * @return {@link List }<{@link OptionDO }> | ||
| 65 | + */ | ||
| 66 | + public List<OptionDO> listFieldBySystemTypeAndDocumentType(String systemType, String documentType) { | ||
| 67 | + SystemType from = SystemType.from(systemType); | ||
| 68 | + DocumentType documentType1 = from.documentTypes.stream().filter(doc -> doc.value.equals(documentType)).findFirst().orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.BUSINESS_MATCHES_ARE_INCORRECT)); | ||
| 69 | + return documentType1.fieldType.stream().map(fieldType -> new OptionDO(fieldType.desc, fieldType.value)).toList(); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * 保存 | ||
| 74 | + * | ||
| 75 | + * @param co 公司 | ||
| 76 | + */ | ||
| 77 | + @Transactional | ||
| 78 | + public void save(PipelineDocFieldTypeCO co) { | ||
| 79 | + SettingFieldType from = SettingFieldType.from(co.getSettingFieldType()); | ||
| 80 | + LambdaQueryWrapper<PipelineDocFieldType> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 81 | + queryWrapper.eq(PipelineDocFieldType::getPipelineId, co.getPipelineId()) | ||
| 82 | + .eq(PipelineDocFieldType::getDocumentType, co.getDocumentType()) | ||
| 83 | + .eq(PipelineDocFieldType::getConfigKey, co.getConfigKey()); | ||
| 84 | + PipelineDocFieldType type = pipelineDocFieldTypeRepository.selectOne(queryWrapper); | ||
| 85 | + Optional.ofNullable(type).ifPresentOrElse( | ||
| 86 | + e -> { | ||
| 87 | + deleteFixedConfig(e); | ||
| 88 | + deleteDynamicConfig(e); | ||
| 89 | + deleteRemoteConfig(e); | ||
| 90 | + e.setSettingFieldType(co.getSettingFieldType()); | ||
| 91 | + pipelineDocFieldTypeRepository.updateById(e); | ||
| 92 | + saveConfig(co, from, e); | ||
| 93 | + }, | ||
| 94 | + () -> { | ||
| 95 | + PipelineDocFieldType newType = new PipelineDocFieldType(); | ||
| 96 | + newType.setPipelineId(co.getPipelineId()); | ||
| 97 | + newType.setDocumentType(co.getDocumentType()); | ||
| 98 | + newType.setConfigKey(co.getConfigKey()); | ||
| 99 | + newType.setSettingFieldType(co.getSettingFieldType()); | ||
| 100 | + pipelineDocFieldTypeRepository.insert(newType); | ||
| 101 | + saveConfig(co, from, newType); | ||
| 102 | + } | ||
| 103 | + ); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + @Transactional | ||
| 107 | + public void deleteRemoteConfig(com.diligrp.tax.storage.domain.PipelineDocFieldType e) { | ||
| 108 | + LambdaQueryWrapper<PipelineDocFieldTypeRemote> wrapper = new LambdaQueryWrapper<PipelineDocFieldTypeRemote>().eq(PipelineDocFieldTypeRemote::getPipelineFieldTypeId, e.getId()); | ||
| 109 | + pipelineDocFieldTypeRemoteRepository.delete(wrapper); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + @Transactional | ||
| 113 | + public void deleteDynamicConfig(com.diligrp.tax.storage.domain.PipelineDocFieldType e) { | ||
| 114 | + LambdaQueryWrapper<PipelineDocFieldTypeDynamic> wrapper = new LambdaQueryWrapper<PipelineDocFieldTypeDynamic>().eq(PipelineDocFieldTypeDynamic::getPipelineFieldTypeId, e.getId()); | ||
| 115 | + pipelineDocFieldTypeDynamicRepository.delete(wrapper); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + @Transactional | ||
| 119 | + public void deleteFixedConfig(com.diligrp.tax.storage.domain.PipelineDocFieldType e) { | ||
| 120 | + LambdaQueryWrapper<PipelineDocFieldTypeFixed> wrapper = new LambdaQueryWrapper<PipelineDocFieldTypeFixed>().eq(PipelineDocFieldTypeFixed::getPipelineFieldTypeId, e.getId()); | ||
| 121 | + pipelineDocFieldTypeFixedRepository.delete(wrapper); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + @Transactional | ||
| 125 | + public void saveConfig(PipelineDocFieldTypeCO co, SettingFieldType from, com.diligrp.tax.storage.domain.PipelineDocFieldType newType) { | ||
| 126 | + switch (from) { | ||
| 127 | + case FIXED -> saveFixedConfig(co, newType); | ||
| 128 | + case DYNAMIC -> saveDynamicConfig(co, newType); | ||
| 129 | + case REMOTE -> saveRemoteConfig(co, newType); | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + @Transactional | ||
| 134 | + public void saveRemoteConfig(PipelineDocFieldTypeCO co, com.diligrp.tax.storage.domain.PipelineDocFieldType newType) { | ||
| 135 | + PipelineDocFieldTypeRemote config = new PipelineDocFieldTypeRemote(); | ||
| 136 | + config.setPipelineFieldTypeId(newType.getId()); | ||
| 137 | + config.setRemoteAddress(co.getPipelineDocFieldTypeRemoteParamDO().getRemoteAddress()); | ||
| 138 | + config.setField(co.getPipelineDocFieldTypeRemoteParamDO().getField()); | ||
| 139 | + config.setDataPath(co.getPipelineDocFieldTypeRemoteParamDO().getDataPath()); | ||
| 140 | + config.setFixedParams(co.getPipelineDocFieldTypeRemoteParamDO().getFixedParams()); | ||
| 141 | + pipelineDocFieldTypeRemoteRepository.insert(config); | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + @Transactional | ||
| 145 | + public void saveDynamicConfig(PipelineDocFieldTypeCO co, com.diligrp.tax.storage.domain.PipelineDocFieldType newType) { | ||
| 146 | + co.getDynamicValueDOS().forEach(dynamicValueDO -> { | ||
| 147 | + PipelineDocFieldTypeDynamic dynamicConfig = new PipelineDocFieldTypeDynamic(); | ||
| 148 | + dynamicConfig.setPipelineFieldTypeId(newType.getId()); | ||
| 149 | + dynamicConfig.setConfigValue(dynamicValueDO.getConfigValue()); | ||
| 150 | + dynamicConfig.setConfigMapValue(dynamicValueDO.getConfigMapValue()); | ||
| 151 | + pipelineDocFieldTypeDynamicRepository.insert(dynamicConfig); | ||
| 152 | + }); | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + @Transactional | ||
| 156 | + public void saveFixedConfig(PipelineDocFieldTypeCO co, PipelineDocFieldType newType) { | ||
| 157 | + PipelineDocFieldTypeFixed config = new PipelineDocFieldTypeFixed(); | ||
| 158 | + config.setPipelineFieldTypeId(newType.getId()); | ||
| 159 | + config.setConfigValue(co.getFixedValue()); | ||
| 160 | + pipelineDocFieldTypeFixedRepository.insert(config); | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + public List<PipelineDocFieldTypeDO> listByPipelineIdAndDocumentType(Long pipelineId, String documentType) { | ||
| 164 | + LambdaQueryWrapper<PipelineDocFieldType> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 165 | + queryWrapper.eq(PipelineDocFieldType::getPipelineId, pipelineId); | ||
| 166 | + queryWrapper.eq(PipelineDocFieldType::getDocumentType, documentType); | ||
| 167 | + List<PipelineDocFieldType> pipelineDocFieldTypes = pipelineDocFieldTypeRepository.selectList(queryWrapper); | ||
| 168 | + return pipelineDocFieldTypes.stream().map(e -> { | ||
| 169 | + PipelineDocFieldTypeDO res = new PipelineDocFieldTypeDO(); | ||
| 170 | + res.setId(e.getId()); | ||
| 171 | + res.setPipelineId(e.getPipelineId()); | ||
| 172 | + res.setDocumentType(e.getDocumentType()); | ||
| 173 | + res.setConfigKey(e.getConfigKey()); | ||
| 174 | + res.setSettingFieldType(SettingFieldType.from(e.getSettingFieldType())); | ||
| 175 | + switch (SettingFieldType.from(e.getSettingFieldType())) { | ||
| 176 | + case FIXED -> res.setFixedValue(queryByPipelineFixedFieldTypeId(e.getId())); | ||
| 177 | + case DYNAMIC -> res.setDynamicValues(queryByPipelineDynamicFieldTypeId(e.getId())); | ||
| 178 | + case REMOTE -> res.setPipelineDocFieldTypeRemoteParamDO(queryByPipelineRemoteFieldTypeId(e.getId())); | ||
| 179 | + } | ||
| 180 | + return res; | ||
| 181 | + }).toList(); | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + /** | ||
| 185 | + * 按管道远程字段类型 ID 查询 | ||
| 186 | + * | ||
| 187 | + * @param id id | ||
| 188 | + * @return {@link PipelineDocFieldTypeRemoteParamDO } | ||
| 189 | + */ | ||
| 190 | + private PipelineDocFieldTypeRemoteParamDO queryByPipelineRemoteFieldTypeId(Long id) { | ||
| 191 | + LambdaQueryWrapper<PipelineDocFieldTypeRemote> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 192 | + queryWrapper.eq(PipelineDocFieldTypeRemote::getPipelineFieldTypeId, id); | ||
| 193 | + PipelineDocFieldTypeRemote pipelineDocFieldTypeRemote = pipelineDocFieldTypeRemoteRepository.selectOne(queryWrapper); | ||
| 194 | + var remote = new PipelineDocFieldTypeRemoteParamDO(); | ||
| 195 | + remote.setRemoteAddress(pipelineDocFieldTypeRemote.getRemoteAddress()); | ||
| 196 | + remote.setField(pipelineDocFieldTypeRemote.getField()); | ||
| 197 | + remote.setDataPath(pipelineDocFieldTypeRemote.getDataPath()); | ||
| 198 | + remote.setFixedParams(pipelineDocFieldTypeRemote.getFixedParams()); | ||
| 199 | + return remote; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + /** | ||
| 203 | + * 按管道动态字段类型 ID 查询 | ||
| 204 | + * | ||
| 205 | + * @param id id | ||
| 206 | + * @return {@link List }<{@link DynamicValueDO }> | ||
| 207 | + */ | ||
| 208 | + private Map<String, String> queryByPipelineDynamicFieldTypeId(Long id) { | ||
| 209 | + LambdaQueryWrapper<PipelineDocFieldTypeDynamic> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 210 | + queryWrapper.eq(PipelineDocFieldTypeDynamic::getPipelineFieldTypeId, id); | ||
| 211 | + List<PipelineDocFieldTypeDynamic> pipelineDocFieldTypeDynamics = pipelineDocFieldTypeDynamicRepository.selectList(queryWrapper); | ||
| 212 | + return pipelineDocFieldTypeDynamics.stream().map(e -> { | ||
| 213 | + var dynamicValue = new DynamicValueDO(); | ||
| 214 | + dynamicValue.setConfigValue(e.getConfigValue()); | ||
| 215 | + dynamicValue.setConfigMapValue(e.getConfigMapValue()); | ||
| 216 | + return dynamicValue; | ||
| 217 | + }).collect(Collectors.toMap(DynamicValueDO::getConfigValue, DynamicValueDO::getConfigMapValue)); | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + /** | ||
| 221 | + * 按管道固定字段类型 ID 查询 | ||
| 222 | + * | ||
| 223 | + * @param id id | ||
| 224 | + * @return {@link String } | ||
| 225 | + */ | ||
| 226 | + private String queryByPipelineFixedFieldTypeId(Long id) { | ||
| 227 | + LambdaQueryWrapper<PipelineDocFieldTypeFixed> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 228 | + queryWrapper.eq(PipelineDocFieldTypeFixed::getPipelineFieldTypeId, id); | ||
| 229 | + PipelineDocFieldTypeFixed pipelineDocFieldTypeFixed = pipelineDocFieldTypeFixedRepository.selectOne(queryWrapper); | ||
| 230 | + return pipelineDocFieldTypeFixed.getConfigValue(); | ||
| 231 | + } | ||
| 232 | +} |
tax-storage/src/main/java/com/diligrp/tax/storage/service/PipelineDocValidService.java
0 → 100644
| 1 | +package com.diligrp.tax.storage.service; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.diligrp.tax.central.model.PipelineDocValidDO; | ||
| 5 | +import com.diligrp.tax.central.model.PipelineValidReturnDO; | ||
| 6 | +import com.diligrp.tax.central.service.IPipelineDocValidService; | ||
| 7 | +import com.diligrp.tax.central.type.DocumentType; | ||
| 8 | +import com.diligrp.tax.central.utils.JsonUtils; | ||
| 9 | +import com.diligrp.tax.storage.domain.PipelineDocValid; | ||
| 10 | +import com.diligrp.tax.storage.domain.PipelineDocValidReturn; | ||
| 11 | +import com.diligrp.tax.storage.model.co.PipelineDocValidCO; | ||
| 12 | +import com.diligrp.tax.storage.model.co.PipelineDocValidReturnCO; | ||
| 13 | +import com.diligrp.tax.storage.model.vo.PipelineDocFieldTypeValidReturnVO; | ||
| 14 | +import com.diligrp.tax.storage.model.vo.PipelineDocFieldTypeValidVO; | ||
| 15 | +import com.diligrp.tax.storage.repo.PipelineDocValidRepository; | ||
| 16 | +import com.diligrp.tax.storage.repo.PipelineDocValidReturnRepository; | ||
| 17 | +import jakarta.annotation.Resource; | ||
| 18 | +import org.springframework.stereotype.Service; | ||
| 19 | +import org.springframework.transaction.annotation.Transactional; | ||
| 20 | + | ||
| 21 | +import java.util.List; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * @Author: zhangmeiyang | ||
| 25 | + * @CreateTime: 2025-11-11 18:36 | ||
| 26 | + * @Version: todo | ||
| 27 | + */ | ||
| 28 | +@Service | ||
| 29 | +public class PipelineDocValidService implements IPipelineDocValidService { | ||
| 30 | + | ||
| 31 | + @Resource | ||
| 32 | + private PipelineDocValidRepository pipelineDocValidRepository; | ||
| 33 | + | ||
| 34 | + @Resource | ||
| 35 | + private PipelineDocValidReturnRepository pipelineDocValidReturnRepository; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 保存验证 | ||
| 39 | + * | ||
| 40 | + * @param list 列表 | ||
| 41 | + */ | ||
| 42 | + @Transactional | ||
| 43 | + public void saveVerify(List<PipelineDocValidCO> list) { | ||
| 44 | + List<PipelineDocValid> saveList = list.stream().map(item -> { | ||
| 45 | + DocumentType.validateDocumentType(item.getDocumentType()); | ||
| 46 | + return JsonUtils.convertValue(item, PipelineDocValid.class); | ||
| 47 | + }).toList(); | ||
| 48 | + pipelineDocValidRepository.insert(saveList); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 删除验证 | ||
| 54 | + * | ||
| 55 | + * @param id id | ||
| 56 | + */ | ||
| 57 | + @Transactional | ||
| 58 | + public void deleteVerify(Long id) { | ||
| 59 | + pipelineDocValidRepository.deleteById(id); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * 按管道列出验证 | ||
| 64 | + * | ||
| 65 | + * @param pipelineId 管道 ID | ||
| 66 | + * @return {@link List }<{@link PipelineDocFieldTypeValidVO }> | ||
| 67 | + */ | ||
| 68 | + public List<PipelineDocFieldTypeValidVO> listVerifyByPipeline(String pipelineId) { | ||
| 69 | + LambdaQueryWrapper<PipelineDocValid> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 70 | + queryWrapper.eq(PipelineDocValid::getPipelineId, pipelineId); | ||
| 71 | + return pipelineDocValidRepository.selectList(queryWrapper).stream().map(item -> JsonUtils.convertValue(item, PipelineDocFieldTypeValidVO.class)).toList(); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 列表按管道和文档验证 | ||
| 76 | + * | ||
| 77 | + * @param co 公司 | ||
| 78 | + * @return {@link List }<{@link PipelineDocFieldTypeValidVO }> | ||
| 79 | + */ | ||
| 80 | + public List<PipelineDocFieldTypeValidVO> listVerifyByPipelineAndDocument(PipelineDocValidCO co) { | ||
| 81 | + LambdaQueryWrapper<PipelineDocValid> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 82 | + queryWrapper.eq(PipelineDocValid::getPipelineId, co.getPipelineId()); | ||
| 83 | + queryWrapper.eq(PipelineDocValid::getDocumentType, co.getDocumentType()); | ||
| 84 | + return pipelineDocValidRepository.selectList(queryWrapper).stream().map(item -> JsonUtils.convertValue(item, PipelineDocFieldTypeValidVO.class)).toList(); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 保存返回键 | ||
| 89 | + * | ||
| 90 | + * @param co 公司 | ||
| 91 | + */ | ||
| 92 | + @Transactional | ||
| 93 | + public void saveReturnKey(PipelineDocValidReturnCO co) { | ||
| 94 | + DocumentType.validateDocumentType(co.getDocumentType()); | ||
| 95 | + pipelineDocValidReturnRepository.insert(JsonUtils.convertValue(co, PipelineDocValidReturn.class)); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + /** | ||
| 99 | + * 按管道获取返回密钥 | ||
| 100 | + * | ||
| 101 | + * @param pipelineId 管道 ID | ||
| 102 | + * @return {@link List }<{@link PipelineDocFieldTypeValidReturnVO }> | ||
| 103 | + */ | ||
| 104 | + public List<PipelineDocFieldTypeValidReturnVO> getReturnKeyByPipeline(String pipelineId) { | ||
| 105 | + LambdaQueryWrapper<PipelineDocValidReturn> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 106 | + queryWrapper.eq(PipelineDocValidReturn::getPipelineId, pipelineId); | ||
| 107 | + return pipelineDocValidReturnRepository.selectList(queryWrapper).stream().map(item -> JsonUtils.convertValue(item, PipelineDocFieldTypeValidReturnVO.class)).toList(); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * 按管道和文档获取返回键 | ||
| 112 | + * | ||
| 113 | + * @param co 公司 | ||
| 114 | + * @return {@link PipelineDocFieldTypeValidReturnVO } | ||
| 115 | + */ | ||
| 116 | + public PipelineDocFieldTypeValidReturnVO getReturnKeyByPipelineAndDocument(PipelineDocValidCO co) { | ||
| 117 | + LambdaQueryWrapper<PipelineDocValidReturn> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 118 | + queryWrapper.eq(PipelineDocValidReturn::getPipelineId, co.getPipelineId()); | ||
| 119 | + queryWrapper.eq(PipelineDocValidReturn::getDocumentType, co.getDocumentType()); | ||
| 120 | + return JsonUtils.convertValue(pipelineDocValidReturnRepository.selectOne(queryWrapper), PipelineDocFieldTypeValidReturnVO.class); | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + /** | ||
| 124 | + * 验证输入 | ||
| 125 | + * | ||
| 126 | + * @param pipelineId 管道 ID | ||
| 127 | + * @param documentType 文档类型 | ||
| 128 | + * @return {@link List }<{@link PipelineDocValidDO }> | ||
| 129 | + */ | ||
| 130 | + @Override | ||
| 131 | + public List<PipelineDocValidDO> verifyInput(Long pipelineId, String documentType) { | ||
| 132 | + LambdaQueryWrapper<PipelineDocValid> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 133 | + queryWrapper.eq(PipelineDocValid::getPipelineId, pipelineId); | ||
| 134 | + queryWrapper.eq(PipelineDocValid::getDocumentType, documentType); | ||
| 135 | + List<PipelineDocValid> taxPipelineFieldVerifies = pipelineDocValidRepository.selectList(queryWrapper); | ||
| 136 | + return taxPipelineFieldVerifies.stream().map(item -> JsonUtils.convertValue(item, PipelineDocValidDO.class)).toList(); | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + /** | ||
| 140 | + * 验证输出 | ||
| 141 | + * | ||
| 142 | + * @param pipelineId 管道 ID | ||
| 143 | + * @param documentType 文档类型 | ||
| 144 | + * @return {@link PipelineValidReturnDO } | ||
| 145 | + */ | ||
| 146 | + @Override | ||
| 147 | + public PipelineValidReturnDO verifyOutput(Long pipelineId, String documentType) { | ||
| 148 | + LambdaQueryWrapper<PipelineDocValidReturn> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 149 | + queryWrapper.eq(PipelineDocValidReturn::getPipelineId, pipelineId); | ||
| 150 | + queryWrapper.eq(PipelineDocValidReturn::getDocumentType, documentType); | ||
| 151 | + PipelineDocValidReturn returnKey = pipelineDocValidReturnRepository.selectOne(queryWrapper); | ||
| 152 | + return JsonUtils.convertValue(returnKey, PipelineValidReturnDO.class); | ||
| 153 | + } | ||
| 154 | +} |
tax-storage/src/main/java/com/diligrp/tax/storage/service/DynamicTaxPipelineMappingService.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/service/PipelineMappingService.java
| @@ -2,16 +2,16 @@ package com.diligrp.tax.storage.service; | @@ -2,16 +2,16 @@ package com.diligrp.tax.storage.service; | ||
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 4 | import com.diligrp.tax.central.exception.TaxAgentServiceException; | 4 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 5 | -import com.diligrp.tax.central.model.TaxPipelineMappingCreate; | ||
| 6 | -import com.diligrp.tax.central.model.TenantTaxPipelineMapping; | ||
| 7 | -import com.diligrp.tax.central.service.ITaxPipelineMappingService; | 5 | +import com.diligrp.tax.central.model.PipelineMappingCreateDO; |
| 6 | +import com.diligrp.tax.central.model.PipelineMappingDO; | ||
| 7 | +import com.diligrp.tax.central.service.IPipelineMappingService; | ||
| 8 | import com.diligrp.tax.central.type.DocumentType; | 8 | import com.diligrp.tax.central.type.DocumentType; |
| 9 | +import com.diligrp.tax.central.type.MappingStateType; | ||
| 9 | import com.diligrp.tax.central.type.TaxSystemType; | 10 | import com.diligrp.tax.central.type.TaxSystemType; |
| 10 | import com.diligrp.tax.central.utils.JsonUtils; | 11 | import com.diligrp.tax.central.utils.JsonUtils; |
| 11 | -import com.diligrp.tax.storage.domain.TaxPipelineMapping; | ||
| 12 | -import com.diligrp.tax.storage.model.co.TaxPipelineMappingCO; | ||
| 13 | -import com.diligrp.tax.storage.repo.TaxPipelineMappingRepository; | ||
| 14 | -import com.diligrp.tax.central.type.MappingStateType; | 12 | +import com.diligrp.tax.storage.domain.PipelineMapping; |
| 13 | +import com.diligrp.tax.storage.model.co.PipelineMappingCO; | ||
| 14 | +import com.diligrp.tax.storage.repo.PipelineMappingRepository; | ||
| 15 | import jakarta.annotation.Resource; | 15 | import jakarta.annotation.Resource; |
| 16 | import org.springframework.stereotype.Component; | 16 | import org.springframework.stereotype.Component; |
| 17 | import org.springframework.transaction.annotation.Transactional; | 17 | import org.springframework.transaction.annotation.Transactional; |
| @@ -26,12 +26,12 @@ import java.util.Optional; | @@ -26,12 +26,12 @@ import java.util.Optional; | ||
| 26 | * @Version: todo | 26 | * @Version: todo |
| 27 | */ | 27 | */ |
| 28 | @Component | 28 | @Component |
| 29 | -public class DynamicTaxPipelineMappingService implements ITaxPipelineMappingService { | 29 | +public class PipelineMappingService implements IPipelineMappingService { |
| 30 | 30 | ||
| 31 | @Resource | 31 | @Resource |
| 32 | - private TaxPipelineMappingRepository taxPipelineMappingRepository; | 32 | + private PipelineMappingRepository pipelineMappingRepository; |
| 33 | 33 | ||
| 34 | - private static final String DEFAULT_TAX_PIPELINE_MAPPING_TABLE_NAME = "tax_pipeline_mapping_"; | 34 | + private static final String DEFAULT_PIPELINE_MAPPING_TABLE_NAME = "pipeline_mapping_"; |
| 35 | 35 | ||
| 36 | /** | 36 | /** |
| 37 | * 创建租户映射表 | 37 | * 创建租户映射表 |
| @@ -41,22 +41,22 @@ public class DynamicTaxPipelineMappingService implements ITaxPipelineMappingServ | @@ -41,22 +41,22 @@ public class DynamicTaxPipelineMappingService implements ITaxPipelineMappingServ | ||
| 41 | @Transactional | 41 | @Transactional |
| 42 | public void createTenantMappingTable(String tenantId) { | 42 | public void createTenantMappingTable(String tenantId) { |
| 43 | String tenantIdValid = Optional.ofNullable(tenantId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); | 43 | String tenantIdValid = Optional.ofNullable(tenantId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); |
| 44 | - String tableName = DEFAULT_TAX_PIPELINE_MAPPING_TABLE_NAME + tenantIdValid; | ||
| 45 | - taxPipelineMappingRepository.createTenantMappingTable(tableName); | 44 | + String tableName = DEFAULT_PIPELINE_MAPPING_TABLE_NAME + tenantIdValid; |
| 45 | + pipelineMappingRepository.createTenantMappingTable(tableName); | ||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | /** | 48 | /** |
| 49 | * 查询租户管道数据 | 49 | * 查询租户管道数据 |
| 50 | * | 50 | * |
| 51 | - * @param taxPipelineMappingCO | ||
| 52 | - * @return {@link List }<{@link TenantTaxPipelineMapping }> | 51 | + * @param pipelineMappingCO |
| 52 | + * @return {@link List }<{@link PipelineMappingDO }> | ||
| 53 | */ | 53 | */ |
| 54 | - public Page<TenantTaxPipelineMapping> findTenantPipelineData(TaxPipelineMappingCO taxPipelineMappingCO) { | ||
| 55 | - Optional.ofNullable(taxPipelineMappingCO.getTenantId()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); | ||
| 56 | - Optional.ofNullable(taxPipelineMappingCO.getPipelineId()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道ID不能为空")); | ||
| 57 | - Page<TenantTaxPipelineMapping> page = new Page<>(taxPipelineMappingCO.getPageNumber(), taxPipelineMappingCO.getPageSize()); | ||
| 58 | - TaxPipelineMapping taxPipelineMapping = JsonUtils.convertValue(taxPipelineMappingCO, TaxPipelineMapping.class); | ||
| 59 | - return taxPipelineMappingRepository.findByPipelineIdAndState(taxPipelineMapping, page); | 54 | + public Page<PipelineMappingDO> findTenantPipelineData(PipelineMappingCO pipelineMappingCO) { |
| 55 | + Optional.ofNullable(pipelineMappingCO.getTenantId()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); | ||
| 56 | + Optional.ofNullable(pipelineMappingCO.getPipelineId()).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道ID不能为空")); | ||
| 57 | + Page<PipelineMappingDO> page = new Page<>(pipelineMappingCO.getPageNumber(), pipelineMappingCO.getPageSize()); | ||
| 58 | + PipelineMapping pipelineMapping = JsonUtils.convertValue(pipelineMappingCO, PipelineMapping.class); | ||
| 59 | + return pipelineMappingRepository.findByPipelineIdAndState(pipelineMapping, page); | ||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | /** | 62 | /** |
| @@ -66,50 +66,50 @@ public class DynamicTaxPipelineMappingService implements ITaxPipelineMappingServ | @@ -66,50 +66,50 @@ public class DynamicTaxPipelineMappingService implements ITaxPipelineMappingServ | ||
| 66 | * @param documentType 文档类型 | 66 | * @param documentType 文档类型 |
| 67 | * @param systemDataId 系统数据 ID | 67 | * @param systemDataId 系统数据 ID |
| 68 | * @param pipelineDataId | 68 | * @param pipelineDataId |
| 69 | - * @return {@link Optional }<{@link TenantTaxPipelineMapping }> | 69 | + * @return {@link Optional }<{@link PipelineMappingDO }> |
| 70 | */ | 70 | */ |
| 71 | @Override | 71 | @Override |
| 72 | - public Optional<TenantTaxPipelineMapping> findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId, String pipelineDataId) { | 72 | + public Optional<PipelineMappingDO> findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId, String pipelineDataId) { |
| 73 | Optional.ofNullable(tenantId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); | 73 | Optional.ofNullable(tenantId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); |
| 74 | Optional.ofNullable(pipelineId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道ID不能为空")); | 74 | Optional.ofNullable(pipelineId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道ID不能为空")); |
| 75 | Optional.ofNullable(documentType).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "文档类型不能为空")); | 75 | Optional.ofNullable(documentType).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "文档类型不能为空")); |
| 76 | Optional.ofNullable(systemDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "系统数据不能为空")); | 76 | Optional.ofNullable(systemDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "系统数据不能为空")); |
| 77 | Optional.ofNullable(pipelineDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道数据不能为空")); | 77 | Optional.ofNullable(pipelineDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道数据不能为空")); |
| 78 | - TaxPipelineMapping taxPipelineMapping = new TaxPipelineMapping(); | ||
| 79 | - taxPipelineMapping.setTenantId(tenantId); | ||
| 80 | - taxPipelineMapping.setPipelineId(pipelineId); | ||
| 81 | - taxPipelineMapping.setDocumentType(documentType); | ||
| 82 | - taxPipelineMapping.setSystemDataId(systemDataId); | ||
| 83 | - taxPipelineMapping.setPipelineDataId(pipelineDataId); | ||
| 84 | - taxPipelineMapping.setState(MappingStateType.SYNCED.value); | ||
| 85 | - return taxPipelineMappingRepository.findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(taxPipelineMapping); | 78 | + PipelineMapping pipelineMapping = new PipelineMapping(); |
| 79 | + pipelineMapping.setTenantId(tenantId); | ||
| 80 | + pipelineMapping.setPipelineId(pipelineId); | ||
| 81 | + pipelineMapping.setDocumentType(documentType); | ||
| 82 | + pipelineMapping.setSystemDataId(systemDataId); | ||
| 83 | + pipelineMapping.setPipelineDataId(pipelineDataId); | ||
| 84 | + pipelineMapping.setState(MappingStateType.SYNCED.value); | ||
| 85 | + return pipelineMappingRepository.findByPipelineIdAndDocumentTypeAndSystemDataIdAndPipelineDataId(pipelineMapping); | ||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | @Override | 88 | @Override |
| 89 | - public Optional<TenantTaxPipelineMapping> findByPipelineIdAndDocumentTypeAndSystemDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId) { | 89 | + public Optional<PipelineMappingDO> findByPipelineIdAndDocumentTypeAndSystemDataId(Long tenantId, Long pipelineId, String documentType, String systemDataId) { |
| 90 | Optional.ofNullable(tenantId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); | 90 | Optional.ofNullable(tenantId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "租户ID不能为空")); |
| 91 | Optional.ofNullable(pipelineId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道ID不能为空")); | 91 | Optional.ofNullable(pipelineId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "管道ID不能为空")); |
| 92 | Optional.ofNullable(documentType).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "文档类型不能为空")); | 92 | Optional.ofNullable(documentType).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "文档类型不能为空")); |
| 93 | Optional.ofNullable(systemDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "系统数据不能为空")); | 93 | Optional.ofNullable(systemDataId).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "系统数据不能为空")); |
| 94 | - TaxPipelineMapping taxPipelineMapping = new TaxPipelineMapping(); | ||
| 95 | - taxPipelineMapping.setTenantId(tenantId); | ||
| 96 | - taxPipelineMapping.setPipelineId(pipelineId); | ||
| 97 | - taxPipelineMapping.setDocumentType(documentType); | ||
| 98 | - taxPipelineMapping.setSystemDataId(systemDataId); | ||
| 99 | - taxPipelineMapping.setState(MappingStateType.SYNCED.value); | ||
| 100 | - return taxPipelineMappingRepository.findByPipelineIdAndDocumentTypeAndSystemDataId(taxPipelineMapping); | 94 | + PipelineMapping pipelineMapping = new PipelineMapping(); |
| 95 | + pipelineMapping.setTenantId(tenantId); | ||
| 96 | + pipelineMapping.setPipelineId(pipelineId); | ||
| 97 | + pipelineMapping.setDocumentType(documentType); | ||
| 98 | + pipelineMapping.setSystemDataId(systemDataId); | ||
| 99 | + pipelineMapping.setState(MappingStateType.SYNCED.value); | ||
| 100 | + return pipelineMappingRepository.findByPipelineIdAndDocumentTypeAndSystemDataId(pipelineMapping); | ||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | @Override | 103 | @Override |
| 104 | - public void insert(@Validated TaxPipelineMappingCreate taxPipelineMappingCreate) { | ||
| 105 | - DocumentType.validateDocumentType(taxPipelineMappingCreate.getDocumentType()); | ||
| 106 | - TaxPipelineMapping taxPipelineMapping = JsonUtils.convertValue(taxPipelineMappingCreate, TaxPipelineMapping.class); | ||
| 107 | - taxPipelineMappingRepository.insert(taxPipelineMapping); | 104 | + public void insert(@Validated PipelineMappingCreateDO pipelineMappingCreateDO) { |
| 105 | + DocumentType.validateDocumentType(pipelineMappingCreateDO.getDocumentType()); | ||
| 106 | + PipelineMapping pipelineMapping = JsonUtils.convertValue(pipelineMappingCreateDO, PipelineMapping.class); | ||
| 107 | + pipelineMappingRepository.insert(pipelineMapping); | ||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | @Override | 110 | @Override |
| 111 | - public void update(TaxPipelineMappingCreate taxPipelineMappingCreate) { | ||
| 112 | - TaxPipelineMapping taxPipelineMapping = JsonUtils.convertValue(taxPipelineMappingCreate, TaxPipelineMapping.class); | ||
| 113 | - taxPipelineMappingRepository.update(taxPipelineMapping); | 111 | + public void update(PipelineMappingCreateDO pipelineMappingCreateDO) { |
| 112 | + PipelineMapping pipelineMapping = JsonUtils.convertValue(pipelineMappingCreateDO, PipelineMapping.class); | ||
| 113 | + pipelineMappingRepository.update(pipelineMapping); | ||
| 114 | } | 114 | } |
| 115 | } | 115 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/service/TaxPipelineService.java renamed to tax-storage/src/main/java/com/diligrp/tax/storage/service/PipelineService.java
| @@ -5,11 +5,11 @@ import com.diligrp.tax.central.exception.TaxAgentServiceException; | @@ -5,11 +5,11 @@ import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 5 | import com.diligrp.tax.central.type.SystemType; | 5 | import com.diligrp.tax.central.type.SystemType; |
| 6 | import com.diligrp.tax.central.type.TaxSystemType; | 6 | import com.diligrp.tax.central.type.TaxSystemType; |
| 7 | import com.diligrp.tax.central.utils.JsonUtils; | 7 | import com.diligrp.tax.central.utils.JsonUtils; |
| 8 | -import com.diligrp.tax.storage.domain.TaxPipeline; | ||
| 9 | -import com.diligrp.tax.storage.model.co.TaxPipelineCO; | ||
| 10 | -import com.diligrp.tax.storage.model.vo.TaxPipelineVO; | ||
| 11 | -import com.diligrp.tax.storage.model.vo.TaxTenantVO; | ||
| 12 | -import com.diligrp.tax.storage.repo.TaxPipelineRepository; | 8 | +import com.diligrp.tax.storage.domain.Pipeline; |
| 9 | +import com.diligrp.tax.storage.model.co.PipelineCO; | ||
| 10 | +import com.diligrp.tax.storage.model.vo.PipelineVO; | ||
| 11 | +import com.diligrp.tax.storage.model.vo.TenantVO; | ||
| 12 | +import com.diligrp.tax.storage.repo.PipelineRepository; | ||
| 13 | import com.diligrp.tax.storage.type.StateType; | 13 | import com.diligrp.tax.storage.type.StateType; |
| 14 | import jakarta.annotation.Resource; | 14 | import jakarta.annotation.Resource; |
| 15 | import jakarta.validation.constraints.NotEmpty; | 15 | import jakarta.validation.constraints.NotEmpty; |
| @@ -26,47 +26,47 @@ import java.util.Optional; | @@ -26,47 +26,47 @@ import java.util.Optional; | ||
| 26 | * @date 2025/11/05 | 26 | * @date 2025/11/05 |
| 27 | */ | 27 | */ |
| 28 | @Service | 28 | @Service |
| 29 | -public class TaxPipelineService { | 29 | +public class PipelineService { |
| 30 | 30 | ||
| 31 | @Resource | 31 | @Resource |
| 32 | - private TaxPipelineRepository taxPipelineRepository; | 32 | + private PipelineRepository pipelineRepository; |
| 33 | 33 | ||
| 34 | @Resource | 34 | @Resource |
| 35 | - private TaxTenantService taxTenantService; | 35 | + private TenantService tenantService; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * 保存 | 38 | * 保存 |
| 39 | * | 39 | * |
| 40 | - * @param taxPipelineCO 税务管道要做 | 40 | + * @param pipelineCO 税务管道要做 |
| 41 | */ | 41 | */ |
| 42 | @Transactional | 42 | @Transactional |
| 43 | - public void save(TaxPipelineCO taxPipelineCO) { | ||
| 44 | - TaxTenantVO tenant = taxTenantService.getTenant(taxPipelineCO.getGroup(), taxPipelineCO.getEntity()); | ||
| 45 | - LambdaQueryWrapper<TaxPipeline> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 46 | - queryWrapper.eq(TaxPipeline::getTenantId, tenant.getId()); | ||
| 47 | - queryWrapper.eq(TaxPipeline::getCode, taxPipelineCO.getCode()); | ||
| 48 | - TaxPipeline taxPipeline1 = taxPipelineRepository.selectOne(queryWrapper); | ||
| 49 | - Optional.ofNullable(taxPipeline1).ifPresent(taxPipeline -> { | 43 | + public void save(PipelineCO pipelineCO) { |
| 44 | + TenantVO tenant = tenantService.getTenant(pipelineCO.getGroup(), pipelineCO.getEntity()); | ||
| 45 | + LambdaQueryWrapper<Pipeline> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 46 | + queryWrapper.eq(Pipeline::getTenantId, tenant.getId()); | ||
| 47 | + queryWrapper.eq(Pipeline::getCode, pipelineCO.getCode()); | ||
| 48 | + Pipeline pipeline1 = pipelineRepository.selectOne(queryWrapper); | ||
| 49 | + Optional.ofNullable(pipeline1).ifPresent(pipeline -> { | ||
| 50 | throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS,"当前账套编码已存在"); | 50 | throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS,"当前账套编码已存在"); |
| 51 | }); | 51 | }); |
| 52 | - taxPipelineCO.setTenantId(tenant.getId()); | ||
| 53 | - SystemType.validateSystemCode(taxPipelineCO.getSystemCode()); | ||
| 54 | - TaxPipeline taxPipeline = JsonUtils.convertValue(taxPipelineCO, TaxPipeline.class); | ||
| 55 | - taxPipeline.setState(StateType.ENABLE.value); | ||
| 56 | - taxPipelineRepository.insert(taxPipeline); | 52 | + pipelineCO.setTenantId(tenant.getId()); |
| 53 | + SystemType.validateSystemCode(pipelineCO.getSystemCode()); | ||
| 54 | + Pipeline pipeline = JsonUtils.convertValue(pipelineCO, Pipeline.class); | ||
| 55 | + pipeline.setState(StateType.ENABLE.value); | ||
| 56 | + pipelineRepository.insert(pipeline); | ||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | /** | 60 | /** |
| 61 | * 更新 | 61 | * 更新 |
| 62 | * | 62 | * |
| 63 | - * @param taxPipelineCO 税务管道公司 | 63 | + * @param pipelineCO 税务管道公司 |
| 64 | */ | 64 | */ |
| 65 | @Transactional | 65 | @Transactional |
| 66 | - public void update(TaxPipelineCO taxPipelineCO) { | ||
| 67 | - SystemType.validateSystemCode(taxPipelineCO.getSystemCode()); | ||
| 68 | - TaxPipeline taxPipeline = JsonUtils.convertValue(taxPipelineCO, TaxPipeline.class); | ||
| 69 | - taxPipelineRepository.updateById(taxPipeline); | 66 | + public void update(PipelineCO pipelineCO) { |
| 67 | + SystemType.validateSystemCode(pipelineCO.getSystemCode()); | ||
| 68 | + Pipeline pipeline = JsonUtils.convertValue(pipelineCO, Pipeline.class); | ||
| 69 | + pipelineRepository.updateById(pipeline); | ||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| @@ -74,25 +74,25 @@ public class TaxPipelineService { | @@ -74,25 +74,25 @@ public class TaxPipelineService { | ||
| 74 | * | 74 | * |
| 75 | * @param group 群 | 75 | * @param group 群 |
| 76 | * @param entity 实体 | 76 | * @param entity 实体 |
| 77 | - * @return {@link List }<{@link TaxPipelineVO }> | 77 | + * @return {@link List }<{@link PipelineVO }> |
| 78 | */ | 78 | */ |
| 79 | - public List<TaxPipelineVO> listByTenant(String group, String entity) { | ||
| 80 | - TaxTenantVO tenant = taxTenantService.getTenant(group, entity); | ||
| 81 | - LambdaQueryWrapper<TaxPipeline> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 82 | - queryWrapper.eq(TaxPipeline::getTenantId, tenant.getId()); | ||
| 83 | - List<TaxPipeline> taxPipelines = taxPipelineRepository.selectList(queryWrapper); | ||
| 84 | - return taxPipelines.stream().map(taxPipeline -> JsonUtils.convertValue(taxPipeline, TaxPipelineVO.class)).toList(); | 79 | + public List<PipelineVO> listByTenant(String group, String entity) { |
| 80 | + TenantVO tenant = tenantService.getTenant(group, entity); | ||
| 81 | + LambdaQueryWrapper<Pipeline> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 82 | + queryWrapper.eq(Pipeline::getTenantId, tenant.getId()); | ||
| 83 | + List<Pipeline> pipelines = pipelineRepository.selectList(queryWrapper); | ||
| 84 | + return pipelines.stream().map(pipeline -> JsonUtils.convertValue(pipeline, PipelineVO.class)).toList(); | ||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | /** | 87 | /** |
| 88 | * 获取 | 88 | * 获取 |
| 89 | * | 89 | * |
| 90 | * @param id id | 90 | * @param id id |
| 91 | - * @return {@link TaxPipelineVO } | 91 | + * @return {@link PipelineVO } |
| 92 | */ | 92 | */ |
| 93 | - public TaxPipelineVO get(Long id) { | ||
| 94 | - TaxPipeline taxPipeline = Optional.ofNullable(taxPipelineRepository.selectById(id)).orElseThrow(() -> new TaxAgentServiceException("未找到当前账套")); | ||
| 95 | - return JsonUtils.convertValue(taxPipeline, TaxPipelineVO.class); | 93 | + public PipelineVO get(Long id) { |
| 94 | + Pipeline pipeline = Optional.ofNullable(pipelineRepository.selectById(id)).orElseThrow(() -> new TaxAgentServiceException("未找到当前账套")); | ||
| 95 | + return JsonUtils.convertValue(pipeline, PipelineVO.class); | ||
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | /** | 98 | /** |
| @@ -102,9 +102,9 @@ public class TaxPipelineService { | @@ -102,9 +102,9 @@ public class TaxPipelineService { | ||
| 102 | * @param stateType 状态类型 | 102 | * @param stateType 状态类型 |
| 103 | */ | 103 | */ |
| 104 | public void updateState(Long id, StateType stateType) { | 104 | public void updateState(Long id, StateType stateType) { |
| 105 | - TaxPipeline taxPipeline = Optional.ofNullable(taxPipelineRepository.selectById(id)).orElseThrow(() -> new TaxAgentServiceException("未找到当前账套")); | ||
| 106 | - taxPipeline.setState(stateType.value); | ||
| 107 | - taxPipelineRepository.updateById(taxPipeline); | 105 | + Pipeline pipeline = Optional.ofNullable(pipelineRepository.selectById(id)).orElseThrow(() -> new TaxAgentServiceException("未找到当前账套")); |
| 106 | + pipeline.setState(stateType.value); | ||
| 107 | + pipelineRepository.updateById(pipeline); | ||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | /** | 110 | /** |
| @@ -112,13 +112,13 @@ public class TaxPipelineService { | @@ -112,13 +112,13 @@ public class TaxPipelineService { | ||
| 112 | * | 112 | * |
| 113 | * @param id id | 113 | * @param id id |
| 114 | * @param pipelineCode 管道代码 | 114 | * @param pipelineCode 管道代码 |
| 115 | - * @return {@link TaxPipelineVO } | 115 | + * @return {@link PipelineVO } |
| 116 | */ | 116 | */ |
| 117 | - public TaxPipelineVO getByTenantIdAndCode(Long id, @NotEmpty String pipelineCode) { | ||
| 118 | - LambdaQueryWrapper<TaxPipeline> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 119 | - queryWrapper.eq(TaxPipeline::getTenantId, id); | ||
| 120 | - queryWrapper.eq(TaxPipeline::getCode, pipelineCode); | ||
| 121 | - TaxPipeline taxPipeline = taxPipelineRepository.selectOne(queryWrapper); | ||
| 122 | - return JsonUtils.convertValue(taxPipeline, TaxPipelineVO.class); | 117 | + public PipelineVO getByTenantIdAndCode(Long id, @NotEmpty String pipelineCode) { |
| 118 | + LambdaQueryWrapper<Pipeline> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 119 | + queryWrapper.eq(Pipeline::getTenantId, id); | ||
| 120 | + queryWrapper.eq(Pipeline::getCode, pipelineCode); | ||
| 121 | + Pipeline pipeline = pipelineRepository.selectOne(queryWrapper); | ||
| 122 | + return JsonUtils.convertValue(pipeline, PipelineVO.class); | ||
| 123 | } | 123 | } |
| 124 | } | 124 | } |
tax-storage/src/main/java/com/diligrp/tax/storage/service/TaxPipelineBusinessConfigService.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.service; | ||
| 2 | - | ||
| 3 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | -import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 7 | -import com.diligrp.tax.central.model.PipelineBusinessKeyword; | ||
| 8 | -import com.diligrp.tax.central.service.ITaxPipelineBusinessKeywordService; | ||
| 9 | -import com.diligrp.tax.central.type.DocumentFieldType; | ||
| 10 | -import com.diligrp.tax.central.type.DocumentType; | ||
| 11 | -import com.diligrp.tax.central.type.DocumentValueWayType; | ||
| 12 | -import com.diligrp.tax.central.type.TaxSystemType; | ||
| 13 | -import com.diligrp.tax.central.utils.JsonUtils; | ||
| 14 | -import com.diligrp.tax.storage.api.response.PipelineBusinessResponse; | ||
| 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; | ||
| 24 | -import jakarta.annotation.Resource; | ||
| 25 | -import org.springframework.stereotype.Service; | ||
| 26 | -import org.springframework.transaction.annotation.Transactional; | ||
| 27 | - | ||
| 28 | -import java.util.List; | ||
| 29 | -import java.util.Optional; | ||
| 30 | - | ||
| 31 | -/** | ||
| 32 | - * @Author: zhangmeiyang | ||
| 33 | - * @CreateTime: 2025-11-13 15:15 | ||
| 34 | - * @Version: todo | ||
| 35 | - */ | ||
| 36 | -@Service | ||
| 37 | -public class TaxPipelineBusinessConfigService implements ITaxPipelineBusinessKeywordService { | ||
| 38 | - @Resource | ||
| 39 | - private TaxPipelineBusinessRepository taxPipelineBusinessRepository; | ||
| 40 | - @Resource | ||
| 41 | - private TaxPipelineBusinessKeywordRepository taxPipelineBusinessKeywordRepository; | ||
| 42 | - @Resource | ||
| 43 | - private TaxTenantService taxTenantService; | ||
| 44 | - @Resource | ||
| 45 | - private TaxPipelineService taxPipelineService; | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 保存业务类型 | ||
| 49 | - * | ||
| 50 | - * @param co 公司 | ||
| 51 | - */ | ||
| 52 | - @Transactional | ||
| 53 | - public void saveBusiness(TaxPipelineBusinessCO co) { | ||
| 54 | - LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 55 | - queryWrapper.eq(TaxPipelineBusiness::getPipelineId, co.getPipelineId()); | ||
| 56 | - queryWrapper.eq(TaxPipelineBusiness::getBusinessCode, co.getBusinessCode()); | ||
| 57 | - Optional.ofNullable(taxPipelineBusinessRepository.selectOne(queryWrapper)).ifPresent(taxPipelineBusiness -> { | ||
| 58 | - throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "业务编码重复"); | ||
| 59 | - }); | ||
| 60 | - taxPipelineBusinessRepository.insert(JsonUtils.convertValue(co, TaxPipelineBusiness.class)); | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - /** | ||
| 64 | - * 更新业务 | ||
| 65 | - * | ||
| 66 | - * @param co 公司 | ||
| 67 | - */ | ||
| 68 | - @Transactional | ||
| 69 | - public void updateBusiness(TaxPipelineBusinessCO co) { | ||
| 70 | - LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 71 | - queryWrapper.eq(TaxPipelineBusiness::getPipelineId, co.getPipelineId()); | ||
| 72 | - queryWrapper.eq(TaxPipelineBusiness::getBusinessCode, co.getBusinessCode()); | ||
| 73 | - Optional.ofNullable(taxPipelineBusinessRepository.selectOne(queryWrapper)).ifPresent(taxPipelineBusiness -> { | ||
| 74 | - throw new TaxAgentServiceException(TaxSystemType.ABNORMAL_PARAMETERS, "业务编码重复"); | ||
| 75 | - }); | ||
| 76 | - taxPipelineBusinessRepository.updateById(JsonUtils.convertValue(co, TaxPipelineBusiness.class)); | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - /** | ||
| 80 | - * 删除业务 | ||
| 81 | - * | ||
| 82 | - * @param id id | ||
| 83 | - */ | ||
| 84 | - @Transactional | ||
| 85 | - public void deleteBusiness(Long id) { | ||
| 86 | - taxPipelineBusinessRepository.deleteById(id); | ||
| 87 | - } | ||
| 88 | - | ||
| 89 | - /** | ||
| 90 | - * 分页查询账套内业务 | ||
| 91 | - * | ||
| 92 | - * @param co 公司 | ||
| 93 | - * @return {@link IPage }<{@link TaxPipelineBusinessVO }> | ||
| 94 | - */ | ||
| 95 | - public IPage<TaxPipelineBusinessVO> pageBusiness(TaxPipelineBusinessCO co) { | ||
| 96 | - LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 97 | - queryWrapper.eq(TaxPipelineBusiness::getPipelineId, co.getPipelineId()); | ||
| 98 | - Page<TaxPipelineBusiness> page = taxPipelineBusinessRepository.selectPage(Page.of(co.getPageNumber(), co.getPageSize()), queryWrapper); | ||
| 99 | - return page.convert(item -> JsonUtils.convertValue(item, TaxPipelineBusinessVO.class)); | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - /** | ||
| 103 | - * 按管道 ID 和业务代码获取 | ||
| 104 | - * | ||
| 105 | - * @param pipelineId 管道 ID | ||
| 106 | - * @param businessCode 业务代码 | ||
| 107 | - * @return {@link PipelineBusinessResponse } | ||
| 108 | - */ | ||
| 109 | - public PipelineBusinessResponse getByPipelineIdAndBusinessCode(Long pipelineId, String businessCode) { | ||
| 110 | - LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 111 | - queryWrapper.eq(TaxPipelineBusiness::getPipelineId, pipelineId); | ||
| 112 | - queryWrapper.eq(TaxPipelineBusiness::getBusinessCode, businessCode); | ||
| 113 | - TaxPipelineBusiness taxPipelineBusiness = taxPipelineBusinessRepository.selectOne(queryWrapper); | ||
| 114 | - // 查询业务信息 | ||
| 115 | - Optional.ofNullable(taxPipelineBusiness).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION, "业务信息不存在")); | ||
| 116 | - PipelineBusinessResponse pipelineBusinessResponse = new PipelineBusinessResponse(); | ||
| 117 | - pipelineBusinessResponse.setId(taxPipelineBusiness.getId()); | ||
| 118 | - pipelineBusinessResponse.setPipelineId(taxPipelineBusiness.getPipelineId()); | ||
| 119 | - pipelineBusinessResponse.setBusinessCode(taxPipelineBusiness.getBusinessCode()); | ||
| 120 | - pipelineBusinessResponse.setBusinessName(taxPipelineBusiness.getBusinessName()); | ||
| 121 | - return pipelineBusinessResponse; | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - /** | ||
| 125 | - * 批量保存业务关键字 | ||
| 126 | - * | ||
| 127 | - * @param cos 因为 | ||
| 128 | - */ | ||
| 129 | - @Transactional | ||
| 130 | - public void batchSaveBusinessKeyword(List<TaxPipelineBusinessKeywordCO> cos) { | ||
| 131 | - Optional.ofNullable(cos).ifPresent(ts -> { | ||
| 132 | - Long taxPipelineBusinessId = ts.getFirst().getTaxPipelineBusinessId(); | ||
| 133 | - LambdaQueryWrapper<TaxPipelineBusinessKeyword> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 134 | - queryWrapper.eq(TaxPipelineBusinessKeyword::getTaxPipelineBusinessId, taxPipelineBusinessId); | ||
| 135 | - taxPipelineBusinessKeywordRepository.delete(queryWrapper); | ||
| 136 | - ts.forEach(co -> { | ||
| 137 | - DocumentType.validateDocumentType(co.getDocumentType()); | ||
| 138 | - TaxPipelineBusinessKeyword taxPipelineBusinessKeyword = JsonUtils.convertValue(co, TaxPipelineBusinessKeyword.class); | ||
| 139 | - taxPipelineBusinessKeywordRepository.insert(taxPipelineBusinessKeyword); | ||
| 140 | - }); | ||
| 141 | - }); | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - /** | ||
| 145 | - * 列表业务关键字 | ||
| 146 | - * | ||
| 147 | - * @param co 公司 | ||
| 148 | - * @return {@link List }<{@link TaxPipelineBusinessKeywordVO }> | ||
| 149 | - */ | ||
| 150 | - public List<TaxPipelineBusinessKeywordVO> listBusinessKeyword(TaxPipelineBusinessKeywordCO co) { | ||
| 151 | - LambdaQueryWrapper<TaxPipelineBusinessKeyword> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 152 | - queryWrapper.eq(TaxPipelineBusinessKeyword::getTaxPipelineBusinessId, co.getTaxPipelineBusinessId()); | ||
| 153 | - return taxPipelineBusinessKeywordRepository.selectList(queryWrapper).stream().map(item -> JsonUtils.convertValue(item, TaxPipelineBusinessKeywordVO.class)).toList(); | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - | ||
| 157 | - /** | ||
| 158 | - * 按租户、管道和业务查询 | ||
| 159 | - * | ||
| 160 | - * @param group 群 | ||
| 161 | - * @param entity 实体 | ||
| 162 | - * @param pipelineCode 管道代码 | ||
| 163 | - * @param businessCode 业务代码 | ||
| 164 | - * @return {@link List }<{@link PipelineBusinessKeyword }> | ||
| 165 | - */ | ||
| 166 | - @Override | ||
| 167 | - public List<PipelineBusinessKeyword> queryByTenantAndPipelineAndBusiness(String group, String entity, String pipelineCode, String businessCode, String documentType) { | ||
| 168 | - Long tenantId = taxTenantService.getTenantId(group, entity); | ||
| 169 | - TaxPipelineVO byTenantIdAndCode = taxPipelineService.getByTenantIdAndCode(tenantId, pipelineCode); | ||
| 170 | - LambdaQueryWrapper<TaxPipelineBusiness> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 171 | - queryWrapper.eq(TaxPipelineBusiness::getPipelineId, byTenantIdAndCode.getId()); | ||
| 172 | - queryWrapper.eq(TaxPipelineBusiness::getBusinessCode, businessCode); | ||
| 173 | - TaxPipelineBusiness taxPipelineBusiness = taxPipelineBusinessRepository.selectOne(queryWrapper); | ||
| 174 | - Optional.ofNullable(taxPipelineBusiness).orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.MISSING_BUSINESS_INFORMATION)); | ||
| 175 | - LambdaQueryWrapper<TaxPipelineBusinessKeyword> wrapper = new LambdaQueryWrapper<>(); | ||
| 176 | - wrapper.eq(TaxPipelineBusinessKeyword::getTaxPipelineBusinessId, taxPipelineBusiness.getId()); | ||
| 177 | - wrapper.eq(TaxPipelineBusinessKeyword::getDocumentType, documentType); | ||
| 178 | - return taxPipelineBusinessKeywordRepository.selectList(wrapper).stream().map(item -> { | ||
| 179 | - PipelineBusinessKeyword pipelineBusinessKeyword = JsonUtils.convertValue(item, PipelineBusinessKeyword.class); | ||
| 180 | - pipelineBusinessKeyword.setDocumentFieldTypeEnum(DocumentFieldType.from(item.getDocumentFieldType())); | ||
| 181 | - pipelineBusinessKeyword.setDocumentValueWayTypeEnum(DocumentValueWayType.from(item.getDocumentValueWay())); | ||
| 182 | - return pipelineBusinessKeyword; | ||
| 183 | - }).toList(); | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - public void saveBusinessKeyword(TaxPipelineBusinessKeywordCO co) { | ||
| 187 | - DocumentType.validateDocumentType(co.getDocumentType()); | ||
| 188 | - TaxPipelineBusinessKeyword taxPipelineBusinessKeyword = JsonUtils.convertValue(co, TaxPipelineBusinessKeyword.class); | ||
| 189 | - taxPipelineBusinessKeywordRepository.insert(taxPipelineBusinessKeyword); | ||
| 190 | - } | ||
| 191 | -} |
tax-storage/src/main/java/com/diligrp/tax/storage/service/TaxPipelineFieldConfigService.java deleted
100644 → 0
| 1 | -package com.diligrp.tax.storage.service; | ||
| 2 | - | ||
| 3 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | -import com.diligrp.tax.central.exception.TaxAgentServiceException; | ||
| 5 | -import com.diligrp.tax.central.model.DynamicValue; | ||
| 6 | -import com.diligrp.tax.central.model.Option; | ||
| 7 | -import com.diligrp.tax.central.model.RemoteParam; | ||
| 8 | -import com.diligrp.tax.central.model.TenantPipelineConfig; | ||
| 9 | -import com.diligrp.tax.central.type.DocumentType; | ||
| 10 | -import com.diligrp.tax.central.type.SettingFieldType; | ||
| 11 | -import com.diligrp.tax.central.type.SystemType; | ||
| 12 | -import com.diligrp.tax.central.type.TaxSystemType; | ||
| 13 | -import com.diligrp.tax.storage.domain.TaxPipelineDynamicConfig; | ||
| 14 | -import com.diligrp.tax.storage.domain.TaxPipelineFieldType; | ||
| 15 | -import com.diligrp.tax.storage.domain.TaxPipelineFixedConfig; | ||
| 16 | -import com.diligrp.tax.storage.domain.TaxPipelineRemoteConfig; | ||
| 17 | -import com.diligrp.tax.storage.model.co.TaxPipelineFieldConfigCO; | ||
| 18 | -import com.diligrp.tax.storage.repo.TaxPipelineDynamicConfigRepository; | ||
| 19 | -import com.diligrp.tax.storage.repo.TaxPipelineFieldTypeRepository; | ||
| 20 | -import com.diligrp.tax.storage.repo.TaxPipelineFixedConfigRepository; | ||
| 21 | -import com.diligrp.tax.storage.repo.TaxPipelineRemoteConfigRepository; | ||
| 22 | -import jakarta.annotation.Resource; | ||
| 23 | -import org.springframework.stereotype.Service; | ||
| 24 | -import org.springframework.transaction.annotation.Transactional; | ||
| 25 | - | ||
| 26 | -import java.util.List; | ||
| 27 | -import java.util.Map; | ||
| 28 | -import java.util.Optional; | ||
| 29 | -import java.util.stream.Collectors; | ||
| 30 | - | ||
| 31 | -/** | ||
| 32 | - * @Author: zhangmeiyang | ||
| 33 | - * @CreateTime: 2025-11-10 17:59 | ||
| 34 | - * @Version: todo | ||
| 35 | - */ | ||
| 36 | -@Service | ||
| 37 | -public class TaxPipelineFieldConfigService { | ||
| 38 | - | ||
| 39 | - @Resource | ||
| 40 | - private TaxPipelineFieldTypeRepository taxPipelineFieldTypeRepository; | ||
| 41 | - @Resource | ||
| 42 | - private TaxPipelineRemoteConfigRepository taxPipelineRemoteConfigRepository; | ||
| 43 | - @Resource | ||
| 44 | - private TaxPipelineFixedConfigRepository taxPipelineFixedConfigRepository; | ||
| 45 | - @Resource | ||
| 46 | - private TaxPipelineDynamicConfigRepository taxPipelineDynamicConfigRepository; | ||
| 47 | - | ||
| 48 | - /** | ||
| 49 | - * 按系统类型列出文档 | ||
| 50 | - * | ||
| 51 | - * @param systemType 系统类型 | ||
| 52 | - * @return {@link List }<{@link Option }> | ||
| 53 | - */ | ||
| 54 | - public List<Option> listDocumentBySystemType(String systemType) { | ||
| 55 | - SystemType from = SystemType.from(systemType); | ||
| 56 | - return from.documentTypes.stream().map(documentType -> new Option(documentType.desc, documentType.value)).toList(); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - /** | ||
| 60 | - * 按系统类型和文档类型列出字段 | ||
| 61 | - * | ||
| 62 | - * @param systemType 系统类型 | ||
| 63 | - * @param documentType 文档类型 | ||
| 64 | - * @return {@link List }<{@link Option }> | ||
| 65 | - */ | ||
| 66 | - public List<Option> listFieldBySystemTypeAndDocumentType(String systemType, String documentType) { | ||
| 67 | - SystemType from = SystemType.from(systemType); | ||
| 68 | - DocumentType documentType1 = from.documentTypes.stream().filter(doc -> doc.value.equals(documentType)).findFirst().orElseThrow(() -> new TaxAgentServiceException(TaxSystemType.BUSINESS_MATCHES_ARE_INCORRECT)); | ||
| 69 | - return documentType1.fieldType.stream().map(fieldType -> new Option(fieldType.desc, fieldType.value)).toList(); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | - * 保存 | ||
| 74 | - * | ||
| 75 | - * @param co 公司 | ||
| 76 | - */ | ||
| 77 | - @Transactional | ||
| 78 | - public void save(TaxPipelineFieldConfigCO co) { | ||
| 79 | - SettingFieldType from = SettingFieldType.from(co.getSettingFieldType()); | ||
| 80 | - LambdaQueryWrapper<TaxPipelineFieldType> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 81 | - queryWrapper.eq(TaxPipelineFieldType::getPipelineId, co.getPipelineId()).eq(TaxPipelineFieldType::getDocumentType, co.getDocumentType()).eq(TaxPipelineFieldType::getConfigKey, co.getConfigKey()); | ||
| 82 | - TaxPipelineFieldType type = taxPipelineFieldTypeRepository.selectOne(queryWrapper); | ||
| 83 | - Optional.ofNullable(type).ifPresentOrElse( | ||
| 84 | - e -> { | ||
| 85 | - deleteFixedConfig(e); | ||
| 86 | - deleteDynamicConfig(e); | ||
| 87 | - deleteRemoteConfig(e); | ||
| 88 | - e.setSettingFieldType(co.getSettingFieldType()); | ||
| 89 | - taxPipelineFieldTypeRepository.updateById(e); | ||
| 90 | - saveConfig(co, from, e); | ||
| 91 | - }, | ||
| 92 | - () -> { | ||
| 93 | - TaxPipelineFieldType newType = new TaxPipelineFieldType(); | ||
| 94 | - newType.setPipelineId(co.getPipelineId()); | ||
| 95 | - newType.setDocumentType(co.getDocumentType()); | ||
| 96 | - newType.setConfigKey(co.getConfigKey()); | ||
| 97 | - newType.setSettingFieldType(co.getSettingFieldType()); | ||
| 98 | - taxPipelineFieldTypeRepository.insert(newType); | ||
| 99 | - saveConfig(co, from, newType); | ||
| 100 | - } | ||
| 101 | - ); | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - @Transactional | ||
| 105 | - public void deleteRemoteConfig(TaxPipelineFieldType e) { | ||
| 106 | - LambdaQueryWrapper<TaxPipelineRemoteConfig> wrapper = new LambdaQueryWrapper<TaxPipelineRemoteConfig>().eq(TaxPipelineRemoteConfig::getPipelineFieldTypeId, e.getId()); | ||
| 107 | - taxPipelineRemoteConfigRepository.delete(wrapper); | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - @Transactional | ||
| 111 | - public void deleteDynamicConfig(TaxPipelineFieldType e) { | ||
| 112 | - LambdaQueryWrapper<TaxPipelineDynamicConfig> wrapper = new LambdaQueryWrapper<TaxPipelineDynamicConfig>().eq(TaxPipelineDynamicConfig::getPipelineFieldTypeId, e.getId()); | ||
| 113 | - taxPipelineDynamicConfigRepository.delete(wrapper); | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - @Transactional | ||
| 117 | - public void deleteFixedConfig(TaxPipelineFieldType e) { | ||
| 118 | - LambdaQueryWrapper<TaxPipelineFixedConfig> wrapper = new LambdaQueryWrapper<TaxPipelineFixedConfig>().eq(TaxPipelineFixedConfig::getPipelineFieldTypeId, e.getId()); | ||
| 119 | - taxPipelineFixedConfigRepository.delete(wrapper); | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - @Transactional | ||
| 123 | - public void saveConfig(TaxPipelineFieldConfigCO co, SettingFieldType from, TaxPipelineFieldType newType) { | ||
| 124 | - switch (from) { | ||
| 125 | - case FIXED -> saveFixedConfig(co, newType); | ||
| 126 | - case DYNAMIC -> saveDynamicConfig(co, newType); | ||
| 127 | - case REMOTE -> saveRemoteConfig(co, newType); | ||
| 128 | - } | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - @Transactional | ||
| 132 | - public void saveRemoteConfig(TaxPipelineFieldConfigCO co, TaxPipelineFieldType newType) { | ||
| 133 | - TaxPipelineRemoteConfig config = new TaxPipelineRemoteConfig(); | ||
| 134 | - config.setPipelineFieldTypeId(newType.getId()); | ||
| 135 | - config.setRemoteAddress(co.getRemoteParam().getRemoteAddress()); | ||
| 136 | - config.setField(co.getRemoteParam().getField()); | ||
| 137 | - config.setDataPath(co.getRemoteParam().getDataPath()); | ||
| 138 | - config.setFixedParams(co.getRemoteParam().getFixedParams()); | ||
| 139 | - taxPipelineRemoteConfigRepository.insert(config); | ||
| 140 | - } | ||
| 141 | - | ||
| 142 | - @Transactional | ||
| 143 | - public void saveDynamicConfig(TaxPipelineFieldConfigCO co, TaxPipelineFieldType newType) { | ||
| 144 | - co.getDynamicValues().forEach(dynamicValue -> { | ||
| 145 | - TaxPipelineDynamicConfig dynamicConfig = new TaxPipelineDynamicConfig(); | ||
| 146 | - dynamicConfig.setPipelineFieldTypeId(newType.getId()); | ||
| 147 | - dynamicConfig.setConfigValue(dynamicValue.getConfigValue()); | ||
| 148 | - dynamicConfig.setConfigMapValue(dynamicValue.getConfigMapValue()); | ||
| 149 | - taxPipelineDynamicConfigRepository.insert(dynamicConfig); | ||
| 150 | - }); | ||
| 151 | - } | ||
| 152 | - | ||
| 153 | - @Transactional | ||
| 154 | - public void saveFixedConfig(TaxPipelineFieldConfigCO co, TaxPipelineFieldType newType) { | ||
| 155 | - TaxPipelineFixedConfig config = new TaxPipelineFixedConfig(); | ||
| 156 | - config.setPipelineFieldTypeId(newType.getId()); | ||
| 157 | - config.setConfigValue(co.getFixedValue()); | ||
| 158 | - taxPipelineFixedConfigRepository.insert(config); | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | - public List<TenantPipelineConfig> listByPipelineIdAndDocumentType(Long pipelineId, String documentType) { | ||
| 162 | - LambdaQueryWrapper<TaxPipelineFieldType> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 163 | - queryWrapper.eq(TaxPipelineFieldType::getPipelineId, pipelineId); | ||
| 164 | - queryWrapper.eq(TaxPipelineFieldType::getDocumentType, documentType); | ||
| 165 | - List<TaxPipelineFieldType> taxPipelineFieldTypes = taxPipelineFieldTypeRepository.selectList(queryWrapper); | ||
| 166 | - return taxPipelineFieldTypes.stream().map(e -> { | ||
| 167 | - TenantPipelineConfig res = new TenantPipelineConfig(); | ||
| 168 | - res.setId(e.getId()); | ||
| 169 | - res.setPipelineId(e.getPipelineId()); | ||
| 170 | - res.setDocumentType(e.getDocumentType()); | ||
| 171 | - res.setConfigKey(e.getConfigKey()); | ||
| 172 | - res.setSettingFieldType(SettingFieldType.from(e.getSettingFieldType())); | ||
| 173 | - switch (SettingFieldType.from(e.getSettingFieldType())) { | ||
| 174 | - case FIXED -> res.setFixedValue(queryByPipelineFixedFieldTypeId(e.getId())); | ||
| 175 | - case DYNAMIC -> res.setDynamicValues(queryByPipelineDynamicFieldTypeId(e.getId())); | ||
| 176 | - case REMOTE -> res.setRemoteParam(queryByPipelineRemoteFieldTypeId(e.getId())); | ||
| 177 | - } | ||
| 178 | - return res; | ||
| 179 | - }).toList(); | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | - /** | ||
| 183 | - * 按管道远程字段类型 ID 查询 | ||
| 184 | - * | ||
| 185 | - * @param id id | ||
| 186 | - * @return {@link RemoteParam } | ||
| 187 | - */ | ||
| 188 | - private RemoteParam queryByPipelineRemoteFieldTypeId(Long id) { | ||
| 189 | - LambdaQueryWrapper<TaxPipelineRemoteConfig> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 190 | - queryWrapper.eq(TaxPipelineRemoteConfig::getPipelineFieldTypeId, id); | ||
| 191 | - TaxPipelineRemoteConfig taxPipelineRemoteConfig = taxPipelineRemoteConfigRepository.selectOne(queryWrapper); | ||
| 192 | - var remote = new RemoteParam(); | ||
| 193 | - remote.setRemoteAddress(taxPipelineRemoteConfig.getRemoteAddress()); | ||
| 194 | - remote.setField(taxPipelineRemoteConfig.getField()); | ||
| 195 | - remote.setDataPath(taxPipelineRemoteConfig.getDataPath()); | ||
| 196 | - remote.setFixedParams(taxPipelineRemoteConfig.getFixedParams()); | ||
| 197 | - return remote; | ||
| 198 | - } | ||
| 199 | - | ||
| 200 | - /** | ||
| 201 | - * 按管道动态字段类型 ID 查询 | ||
| 202 | - * | ||
| 203 | - * @param id id | ||
| 204 | - * @return {@link List }<{@link DynamicValue }> | ||
| 205 | - */ | ||
| 206 | - private Map<String, String> queryByPipelineDynamicFieldTypeId(Long id) { | ||
| 207 | - LambdaQueryWrapper<TaxPipelineDynamicConfig> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 208 | - queryWrapper.eq(TaxPipelineDynamicConfig::getPipelineFieldTypeId, id); | ||
| 209 | - List<TaxPipelineDynamicConfig> taxPipelineDynamicConfigs = taxPipelineDynamicConfigRepository.selectList(queryWrapper); | ||
| 210 | - return taxPipelineDynamicConfigs.stream().map(e -> { | ||
| 211 | - var dynamicValue = new DynamicValue(); | ||
| 212 | - dynamicValue.setConfigValue(e.getConfigValue()); | ||
| 213 | - dynamicValue.setConfigMapValue(e.getConfigMapValue()); | ||
| 214 | - return dynamicValue; | ||
| 215 | - }).collect(Collectors.toMap(DynamicValue::getConfigValue, DynamicValue::getConfigMapValue)); | ||
| 216 | - } | ||
| 217 | - | ||
| 218 | - /** | ||
| 219 | - * 按管道固定字段类型 ID 查询 | ||
| 220 | - * | ||
| 221 | - * @param id id | ||
| 222 | - * @return {@link String } | ||
| 223 | - */ | ||
| 224 | - private String queryByPipelineFixedFieldTypeId(Long id) { | ||
| 225 | - LambdaQueryWrapper<TaxPipelineFixedConfig> queryWrapper = new LambdaQueryWrapper<>(); | ||
| 226 | - queryWrapper.eq(TaxPipelineFixedConfig::getPipelineFieldTypeId, id); | ||
| 227 | - TaxPipelineFixedConfig taxPipelineFixedConfig = taxPipelineFixedConfigRepository.selectOne(queryWrapper); | ||
| 228 | - return taxPipelineFixedConfig.getConfigValue(); | ||
| 229 | - } | ||
| 230 | -} |