BussinessModelConvertService.java
1.74 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 cn.com.glsx.entmicro.service;
import cn.com.glsx.entmicro.kafka.model.CustomerGroupModel;
import cn.com.glsx.entmicro.kafka.model.CustomerModel;
import cn.com.glsx.entmicro.model.request.CustomerBaseRequest;
import cn.com.glsx.entmicro.model.request.CustomerStandardRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zhouhaibao
* @version 1.0
* @description: 业务转化
* @date 2021/9/23 14:29
*/
@Service
public class BussinessModelConvertService {
@Autowired
private CustomerService customerService;
@Autowired
private CustomerBaseService customerBaseService;
/**
* 转化参数
*
* @param customerModel 入参
* @return
*/
public CustomerStandardRequest converCustomer(CustomerModel customerModel) {
CustomerStandardRequest entmicroCustomer = customerService.getEntmicroCustomer(customerModel.getMerchantId(), customerModel.getExternalUserId());
entmicroCustomer.setState(customerModel.getState());
entmicroCustomer.setWelcomeCode(customerModel.getWelcomeCode());
entmicroCustomer.setAddStaffUserId(customerModel.getUserId());
entmicroCustomer.setMerchantId(customerModel.getMerchantId());
return entmicroCustomer;
}
/**
* 转化参数
*
* @param customerGroupModel 入参
* @return
*/
public CustomerBaseRequest converCustomerGroup(CustomerGroupModel customerGroupModel) {
CustomerBaseRequest customerBase = customerBaseService.getCustomerBase(customerGroupModel.getChatId(), customerGroupModel.getMerchantId());
customerBase.setUpdateDetail(customerGroupModel.getUpdateDetail());
return customerBase;
}
}