AdoptMessageController.java
1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.diligrp.tax.adopt.api;
import com.diligrp.tax.adopt.model.ReceiveMessageCO;
import com.diligrp.tax.adopt.service.AdoptMessageService;
import com.diligrp.tax.central.message.Message;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* @author lvqi
*/
@RestController
@RequestMapping("/tax/tenant/adopt")
@AllArgsConstructor
public class AdoptMessageController {
private final AdoptMessageService adoptMessageService;
/**
* 接收消息
*
* @param receiveMessageCO 接收消息
* @return {@link Message }<{@link ? }>
*/
@PostMapping("/message")
public Message<?> receiveMessage(@RequestBody ReceiveMessageCO receiveMessageCO) {
adoptMessageService.convertMessage(receiveMessageCO);
return Message.success();
}
/**
* 完全同步客户(金蝶)
*
* @param file 文件
* @param group 群
* @param entity 实体
* @param pipelineCode 管道代码
* @param documentType 文档类型
* @return {@link Message }<{@link ? }>
*/
@RequestMapping("/fullySyncCustomer/{group}/{entity}/{pipelineCode}/{documentType}")
public Message<?> fullySyncCustomer(@RequestPart("file") @NotNull MultipartFile file,
@PathVariable("group") String group,
@PathVariable("entity") String entity,
@PathVariable("pipelineCode") String pipelineCode,
@PathVariable("documentType") String documentType) {
adoptMessageService.fullySyncCustomer(file, group, entity, pipelineCode, documentType);
return Message.success();
}
}