Commit f9cf242861d33840423dbed586e43c8cd0888f47
1 parent
47872e7b
feat(adopt): 增加消息转换时的系统类型设置
Showing
2 changed files
with
9 additions
and
0 deletions
tax-adopt/src/main/java/com/diligrp/tax/adopt/model/ReceiveMessageCO.java
| 1 | 1 | package com.diligrp.tax.adopt.model; |
| 2 | 2 | |
| 3 | +import com.diligrp.tax.central.type.SystemType; | |
| 3 | 4 | import lombok.Data; |
| 4 | 5 | |
| 5 | 6 | import java.util.Map; |
| ... | ... | @@ -40,4 +41,6 @@ public class ReceiveMessageCO { |
| 40 | 41 | * 消息信息 |
| 41 | 42 | */ |
| 42 | 43 | private Map<String, Object> msgBody; |
| 44 | + | |
| 45 | + private SystemType systemType; | |
| 43 | 46 | } | ... | ... |
tax-adopt/src/main/java/com/diligrp/tax/adopt/service/impl/AdoptMessageServiceImpl.java
| ... | ... | @@ -4,7 +4,9 @@ import com.diligrp.tax.adopt.model.ReceiveMessageCO; |
| 4 | 4 | import com.diligrp.tax.adopt.service.AdoptMessageService; |
| 5 | 5 | import com.diligrp.tax.central.exception.TaxAgentServiceException; |
| 6 | 6 | import com.diligrp.tax.central.model.PipelineBusinessKeyword; |
| 7 | +import com.diligrp.tax.central.model.TenantPipeline; | |
| 7 | 8 | import com.diligrp.tax.central.service.ITaxPipelineBusinessKeywordService; |
| 9 | +import com.diligrp.tax.central.service.ITaxTenantService; | |
| 8 | 10 | import com.diligrp.tax.central.utils.AdoptUtils; |
| 9 | 11 | import com.diligrp.tax.central.utils.JsonUtils; |
| 10 | 12 | import lombok.AllArgsConstructor; |
| ... | ... | @@ -15,6 +17,7 @@ import org.springframework.web.multipart.MultipartFile; |
| 15 | 17 | |
| 16 | 18 | import java.util.List; |
| 17 | 19 | import java.util.Map; |
| 20 | +import java.util.Optional; | |
| 18 | 21 | |
| 19 | 22 | import static com.diligrp.tax.central.queue.TaxAutoPush.NORMAL_EXCHANGE; |
| 20 | 23 | import static com.diligrp.tax.central.queue.TaxAutoPush.NORMAL_ROUTING; |
| ... | ... | @@ -28,6 +31,7 @@ public class AdoptMessageServiceImpl implements AdoptMessageService { |
| 28 | 31 | |
| 29 | 32 | private final ITaxPipelineBusinessKeywordService taxPipelineBusinessKeywordService; |
| 30 | 33 | private final RabbitTemplate rabbitTemplate; |
| 34 | + private final ITaxTenantService taxTenantService; | |
| 31 | 35 | |
| 32 | 36 | @Override |
| 33 | 37 | public void convertMessage(ReceiveMessageCO receiveMessageCO) { |
| ... | ... | @@ -41,6 +45,8 @@ public class AdoptMessageServiceImpl implements AdoptMessageService { |
| 41 | 45 | String json = JsonUtils.toJsonString(msgBody); |
| 42 | 46 | Map<String, Object> map = AdoptUtils.handleAdopt(pipelineBusinessKeywords, json); |
| 43 | 47 | receiveMessageCO.setMsgBody(map); |
| 48 | + Optional<TenantPipeline> byTenantAndPipelineCode = taxTenantService.findByTenantAndPipelineCode(receiveMessageCO.getGroup(), receiveMessageCO.getEntity(), receiveMessageCO.getPipelineCode()); | |
| 49 | + byTenantAndPipelineCode.ifPresent(tenantPipeline -> receiveMessageCO.setSystemType(tenantPipeline.getSystemType())); | |
| 44 | 50 | // 发送mq |
| 45 | 51 | String messageJson = JsonUtils.toJsonString(receiveMessageCO); |
| 46 | 52 | rabbitTemplate.convertAndSend(NORMAL_EXCHANGE, NORMAL_ROUTING, messageJson); | ... | ... |