Commit 47872e7b6d9da44502aef691b409c7bb1be1dc18

Authored by zhangmeiyang
1 parent 24ffc10f

feat(adopt): 新增客户完全同步功能

- 在 AdoptMessageController 中新增 /fullySyncCustomer 接口
- 支持通过 MultipartFile 上传文件进行客户数据同步
- 在 AdoptMessageService 中定义 fullySyncCustomer 方法
- 实现类 AdoptMessageServiceImpl 中添加空实现
- 优化代码导入语句,统一使用通配符导入

fix(storage): 修正参数注释描述

- 修改 saveBusinessKeyword 接口的参数注释
- 将 cos 描述更正为公司 co

feat(storage): 实现租户管道查询方法

- 在 ITaxTenantService 接口中新增 findByTenantAndPipelineCode 方法
- 在 TaxTenantService 中实现该方法的具体逻辑
- 根据 group、entity 和 pipelineCode 查询对应的 TenantPipeline
- 使用 Optional 返回结果,提高代码健壮性
- 修复 listByPipelineIdAndDocumentType 方法中的空格格式问题
tax-adopt/src/main/java/com/diligrp/tax/adopt/api/AdoptMessageController.java
... ... @@ -4,10 +4,8 @@ import com.diligrp.tax.adopt.model.ReceiveMessageCO;
4 4 import com.diligrp.tax.adopt.service.AdoptMessageService;
5 5 import com.diligrp.tax.central.message.Message;
6 6 import lombok.AllArgsConstructor;
7   -import org.springframework.web.bind.annotation.PostMapping;
8   -import org.springframework.web.bind.annotation.RequestBody;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RestController;
  7 +import org.springframework.web.bind.annotation.*;
  8 +import org.springframework.web.multipart.MultipartFile;
11 9  
12 10 /**
13 11 * @author lvqi
... ... @@ -25,4 +23,10 @@ public class AdoptMessageController {
25 23 adoptMessageService.convertMessage(receiveMessageCO);
26 24 return Message.success();
27 25 }
  26 +
  27 + @PostMapping("/fullySyncCustomer")
  28 + public Message<?> fullySyncCustomer(@RequestPart("file")MultipartFile file) {
  29 + adoptMessageService.fullySyncCustomer(file);
  30 + return Message.success();
  31 + }
28 32 }
... ...
tax-adopt/src/main/java/com/diligrp/tax/adopt/service/AdoptMessageService.java
1 1 package com.diligrp.tax.adopt.service;
2 2  
3 3 import com.diligrp.tax.adopt.model.ReceiveMessageCO;
  4 +import org.springframework.web.multipart.MultipartFile;
4 5  
5 6 /**
6 7 * @author lvqi
7 8 */
8 9 public interface AdoptMessageService {
9 10  
  11 + /**
  12 + * @param receiveMessageCO 接收消息
  13 + */
10 14 void convertMessage(ReceiveMessageCO receiveMessageCO);
  15 +
  16 + /**
  17 + * 完全同步客户
  18 + *
  19 + * @param file
  20 + */
  21 + void fullySyncCustomer(MultipartFile file);
11 22 }
... ...
tax-adopt/src/main/java/com/diligrp/tax/adopt/service/impl/AdoptMessageServiceImpl.java
... ... @@ -11,6 +11,7 @@ import lombok.AllArgsConstructor;
11 11 import org.springframework.amqp.rabbit.core.RabbitTemplate;
12 12 import org.springframework.stereotype.Service;
13 13 import org.springframework.util.CollectionUtils;
  14 +import org.springframework.web.multipart.MultipartFile;
14 15  
15 16 import java.util.List;
16 17 import java.util.Map;
... ... @@ -44,4 +45,9 @@ public class AdoptMessageServiceImpl implements AdoptMessageService {
44 45 String messageJson = JsonUtils.toJsonString(receiveMessageCO);
45 46 rabbitTemplate.convertAndSend(NORMAL_EXCHANGE, NORMAL_ROUTING, messageJson);
46 47 }
  48 +
  49 + @Override
  50 + public void fullySyncCustomer(MultipartFile file) {
  51 +
  52 + }
47 53 }
... ...
tax-central/src/main/java/com/diligrp/tax/central/service/ITaxTenantService.java
... ... @@ -4,6 +4,7 @@ import com.diligrp.tax.central.model.TenantPipeline;
4 4 import com.diligrp.tax.central.model.TenantPipelineConfig;
5 5  
6 6 import java.util.List;
  7 +import java.util.Optional;
7 8  
8 9 /**
9 10 * @Author: zhangmeiyang
... ... @@ -28,6 +29,14 @@ public interface ITaxTenantService {
28 29 */
29 30 List<TenantPipeline> listAllEnablePipeline();
30 31  
  32 +
  33 + /**
  34 + * 列出所有启用管道
  35 + *
  36 + * @return {@link List }<{@link TenantPipeline }>
  37 + */
  38 + Optional<TenantPipeline> findByTenantAndPipelineCode(String group,String entity,String pipelineCode);
  39 +
31 40 /**
32 41 * 按管道 ID 列出
33 42 *
... ...
tax-storage/src/main/java/com/diligrp/tax/storage/controller/TaxPipelineBusinessConfigController.java
... ... @@ -160,7 +160,7 @@ public class TaxPipelineBusinessConfigController {
160 160 /**
161 161 * 批量保存业务关键字
162 162 *
163   - * @param cos 对象列表
  163 + * @param co 公司
164 164 * @return {@link Message }<{@link ? }>
165 165 */
166 166 @RequestMapping("/keyword/saveBusinessKeyword")
... ...
tax-storage/src/main/java/com/diligrp/tax/storage/service/TaxTenantService.java
... ... @@ -76,6 +76,19 @@ public class TaxTenantService implements ITaxTenantService {
76 76 }).toList();
77 77 }
78 78  
  79 + @Override
  80 + public Optional<TenantPipeline> findByTenantAndPipelineCode(String group, String entity, String pipelineCode) {
  81 + Long tenantId = getTenantId(group, entity);
  82 + LambdaQueryWrapper<TaxPipeline> queryWrapper = new LambdaQueryWrapper<>();
  83 + queryWrapper.eq(TaxPipeline::getCode, pipelineCode);
  84 + queryWrapper.eq(TaxPipeline::getTenantId, tenantId);
  85 + return Optional.ofNullable(taxPipelineRepository.selectOne(queryWrapper)).map(taxPipeline -> {
  86 + TenantPipeline pipeline = JsonUtils.convertValue(taxPipeline, TenantPipeline.class);
  87 + pipeline.setSystemType(SystemType.from(taxPipeline.getSystemCode()));
  88 + return pipeline;
  89 + });
  90 + }
  91 +
79 92 /**
80 93 * 按管道 ID 列出
81 94 *
... ... @@ -84,7 +97,7 @@ public class TaxTenantService implements ITaxTenantService {
84 97 */
85 98 @Override
86 99 public List<TenantPipelineConfig> listByPipelineIdAndDocumentType(Long pipelineId, String documentType) {
87   - return taxPipelineFieldConfigService.listByPipelineIdAndDocumentType(pipelineId,documentType);
  100 + return taxPipelineFieldConfigService.listByPipelineIdAndDocumentType(pipelineId, documentType);
88 101 }
89 102  
90 103  
... ...